Jesdisciple wrote:Whether that statement is wrapped in a function or not, all it does is return NIL on my setup.
In Common Lisp there are no statements, there are only expressions. Which means that everything has to return something (well, more or less), and usually a side-effecting function, like (format t ...) will return NIL. If you want to print something, why are you concerned with return value?
Usually code in Lisp is run from the REPL, which is Read-Eval-Print Loop, and it will print results of expressions which forms entered into return, but that is not relevant for printing in general. Anyway, on my Clisp:
Code: Select all
[1]> (defun hello-world ()
(format t "Hello, world!"))
HELLO-WORLD
[2]> (hello-world)
Hello, world!
NIL
Where the line before last is the line printed by format, and the last one is the return value printed by REPL. What is you problem, exactly?
EDIT: Oh, I see the installation guide you are using also explains Emacs/Slime setup, which is good. In that setup the output from side effecting printing will go to *inferior-lisp* buffer by default. You can get all output in REPL buffer by putting in file ~/.swank.lisp
Code: Select all
(SETF SWANK:*GLOBALLY-REDIRECT-IO* T)
Case is not important.
EDIT 2: Also forgot to mention that, unless the situation improved recently, Common Lisp packages in distribution repositories are usually really old. I would recommend using
clbuild to get them, starting with slime.