Friday, July 3, 2009

"Everything in lisp is a function"

If, "Everything in Unix is a file",for lisp it must be "everything in lisp is a function". It forms a type of unified theme for programming in lisp, any dialect of lisp.
I have created a table to list some of the functions I have learnt of so far. To see it do click here.

Program execution

To know about the lisp program and its structure, please read my previous post.Here, I intend to describe how to go about executing the lists (or programs, whatever you want to call it as every program is a list in lisp and any list has the potential of being executed as a program).
Now, consider the program given below,
(+ 1 2 3)
which returns the sum (1+ 2 + 3) = 6. In order to execute the program, copy or type the code in an emacs buffer. Then place the cursor (or point as it is called in emacs jargon) at the end of the ending parenthesis of your program (or on any empty space after the ending parenthesis) and type C-x C-e (that is, hold down Ctrl and press x then release then hold down Ctrl and press e and then release). Having done that watch the echo window of you emacs editor that is the lower half for the output


Post a Comment