Range Over Iterators in Lisp
Our first program will print the classic “hello world” message. Here’s the full source code.
To run the program, save the code into a file, for example, hello-world.lisp
, and then use your preferred Common Lisp implementation to load and run it. For example, using SBCL (Steel Bank Common Lisp):
Sometimes, we want to compile our programs into a binary that can be executed directly. Here’s how you can create an executable using SBCL.
First, write the following code to a file called hello-world.lisp
.
Then, run this command to generate the executable:
You should see a new file named hello-world
in your directory. You can run it directly:
Now that we can run and build basic Common Lisp programs, let’s learn more about the language.