I have been working on this problems, " make a function that given two months, say if the first month appears before the second in the calendar printing true " . I can only use , cons, append, list, equal, defun, car, cdr, cond , T , NIL
I though the best way to do this is , assing a value to each of the months , and make separated functions , one funtions for the months and another one that verify the month.
Here my code: I wont paste all of it just cause im still testing: I did it this way , not sure if I assigned the correct value to the month , cause im not sure how to assing a value to a string.
(defun months(month)
(cond ((null month)0)
((= month (format t "january") 1))
((= month (format t "february") 2))
nil ))
the other function:
(defun check-month(month1 month2)
(if (< (months month1) (months month2))
T
NIL
)
)
and when I called the function check-month it says:
(check-month "january" "february")
*** - IF: variable months has no value
The actual result should be like this:
(check-month “january” ”february”)
T