Reputation: 2901
I'm unable to print the return value of return-str.
; return-str.lisp
(defun ask-for-input(str)
(princ str)
(let ((cmd (read-line)))
cmd))
(defun return-str()
(let ((data-str (ask-for-input "enter a string")))
(data-str)))
(princ return-str)
Executing the code above with clisp, I got:
$ clisp return-str.lisp
*** - EVAL: variable RETURN-STR has no value
Please help me on how to properly return a string from return-str.
Thank you.
Upvotes: 0
Views: 1880
Reputation: 29759
Your parentheses are incorrect in a couple of places.
(data-str)
should be replaced with data-str
because data-str
is not a function.(princ return-str)
should be replaced with (princ (return-str))
because return-str
is a function.Upvotes: 3