Package Installation
Lisp Package Required |
If you are new to Lisp programing , here's the packages that you need to install.
- emacs
- slime
- sbcl
- sudo apt-get install emacs
- sudo apt-get install slime
- sudo apt-get install sbcl
And you are good to go.
Your First Lisp Program
To begin programing type emacs in the terminal, to launch emacs.
I strongly recommend using emacs and not gedit. Compare the two if you want, I am 100% sure you will prefer emacs.
- Create a new file using the file menu.
- Type some lisp code.
- Save again using the file menu.
Shortcuts in Emacs
Do not attempt to use the shortcut keys, emacs have different shortcut keys. Which means that Ctrl+x will not be a shortcut for cut, instead it is a shortcut for save.Either learn emacs shortcuts and or instead use the GUI.
Compiling & Execution
Create the following script file. Save it as sbcl.compile.
#!/bin/bash sbcl --noinform --eval "(compile-file \"$1\")" --eval "(quit)" > /dev/null
Next create the following script file. Save this as sbcl.run.
#!/bin/bash sbcl --noinform --load "$1" --quit --end-toplevel-options "$@"
Finally to add the execute permission to these files.
chmod +x sbcl.*
Fire up the following commands in succession to get your code running
- sh sbcl.compile filename.lisp
- sh sbcl.run filename.fasl
Now the hard part begins..., Enjoy Lisp programing !
No comments:
Post a Comment