(format t "Hello, World!")
Hello World in Lisp was written by:
This article was written by:
If you see anything you'd like to change or update, please consider contributing.
Unfortunately, Lisp has many flavors which means the following implementation of Hello World will likely only be applicable to handful of those flavors:
That said, I'm happy to dig into this implementation of Hello World in Lisp.
First things first, we have the
format keyword. In Common Lisp,
basically the equivalent to
printf in C. It basically takes some string and
outputs it to some destination.
That brings us to this mysterious letter
t. According to gigamonkeys,
actually the destination of the output. More specifically,
t indicates standard
output. Another option is
NIL which causes the string to be returned.
Finally, we have our Hello World string. This is obviously what gets printed to standard output.
If we want to try it ourselves, we can copy the code above into an online Common Lisp compiler. The one I linked is in CLISP, but it gets the job done.
sbcl --script hello-world.lsp
And, that should produce the "Hello, World!" string on the command line.