top of page
Search

Getting Started

Updated: Nov 12, 2021

So you've heard of Lisp but how do you do Lisp? For being such a classic language that has been around for more than 60 years, sometimes it feels like there's a barrier to entry to get a full Lisp system running even though you may have come across articles or books mentioning legendary Lisp environments from the past.


My suggestion would be to go over to https://www.common-lisp.net/ and click on the Getting Started button. There they have information about several Lisp implementations including two of my favorites: LispWorks and CLISP.


I would recommend either downloading the Personal Edition of LispWorks from: http://www.lispworks.com/ or the excellent self-contained IDE and Lisp Environment named Portacle (Portable Common Lisp IDE) which automatically installs CLISP for you. Portacle can be found here: https://portacle.github.io/


On Linux, I would recommend installing CLISP with your Linux package manager and using your favorite editor to begin to write code. E.g on Debian derived distros:

sudo apt update
sudo apt install clisp

Another tip: CLISP can be used within Linux in a scripting mode by specifying the name of the scripting shell at the top of the file (like other scripting languages). Sometimes this is an easy way to get into Lisp if you are comfortable with this style of programming, although you will eventually need to learn the REPL (read-eval-print-loop) shell to understand more about Lisp. (No! Python is not the first language to use a REPL.)

#!/usr/bin/clisp

(defstruct monster species name size strength life)
(let* ((goblin1 (make-monster :species 'goblin
			      :name 'goar
			      :size 45
			      :strength 37
			      :life 100))
       (goblin2 (make-monster :species 'goblin
			      :name 'draag
			      :size 59
			      :strength 30
			      :life 100))
       (goblins (list goblin1 goblin2)))

  (loop for g in goblins do
    (format t "~% species: ~a name: ~a size: ~a strength: ~a life: ~a"
      (monster-species g)
      (monster-name g)
      (monster-size g)
      (monster-strength g)
      (monster-life g))))
      
species: GOBLIN name: GOAR size: 45 strength: 37 life: 100
species: GOBLIN name: DRAAG size: 59 strength: 30 life: 100 
52 views0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page