I am trying to make a translate function that takes a list of numbers `(1 2 3) and writes ("ONE" "TWO" "THREE"). Here's what I have so far:
(defun translate-number (num)
(if (= num 0) (return "ZERO") ())
(if (= num 1) (return "ONE") ())
(if (= num 2) (return "TWO") ())
(if (= num 3) (return "THREE") ())
(if (= num 4) (return "FOUR") ())
(if (= num 5) (return "FIVE") ())
(if (= num 6) (return "SIX") ())
(if (= num 7) (return "SEVEN") ())
(if (= num 8) (return "EIGHT") ())
(if (= num 9) (return "NINE") ())
)
(defun translate (L)
(mapcar #'translate-number L)
)
(translate `(1 2 3))
If I try to run this, I get this error that I have not been able to figure out:
*** - RETURN-FROM: no block named NIL is currently visible
Any ideas? Thanks.