14

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.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
Stan Kurilin
  • 15,614
  • 21
  • 81
  • 132

1 Answers1

14

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.

Nick Dandoulakis
  • 42,588
  • 16
  • 104
  • 136