Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lisp simple question

I have some not understanding actions from gnu clisp Suppose, I have some code like (let ((x "Hi!"))(print x)). If I execute it from console (like, clisp fileName.lisp) I see

Hi!

But, when I execute it from interpreter, I see this text twice. Why?

Help me, please.

like image 573
Stan Kurilin Avatar asked Feb 28 '10 11:02

Stan Kurilin


1 Answers

The interpreter always outputs the value of the last expression.
print also returns the parameter as a value, "Hi!" in your case.
That's why you see it twice.

(print "Hi!") 

will give the same result.

like image 71
Nick Dandoulakis Avatar answered Oct 22 '22 01:10

Nick Dandoulakis