You are here: Home / User Group Association Program / Book Reviews / Land Of Lisp by Conrad Barski MD, Review by Raj Jammalamadaka

Land Of Lisp by Conrad Barski MD, Review by Raj Jammalamadaka

by Tony Cappellini posted on Dec 20, 2010 05:25 AM last modified Feb 06, 2011 04:09 AM —

LISP stands for List Processing. This book is a nice introduction to the Common LISP programming language. I started using the EMACS editor recently and really love it. As a result I wanted to learn more about the language on which the EMACS editor is built upon.

Link to the book: http://oreilly.com/catalog/9781593272814

 

Books website:  http://landoflisp.com

 

 LandOfLispThis book starts from the real basics of the language and teaches the language by using games in each chapter. The author makes sure to point out the important points by using notes/warnings and cartoons!

 
Although, I was able to read only the first few chapters, I can definitely say that if you want to learn the LISP language and have fun at the same time, you need this book.
 
Let me show an example to demonstrate some of the features of the LISP language.
 
In this example, we create a list of lists of random numbers below 10.
While creating each sublist of this list of lists, we use the substitute-if function
to substitute the odd numbers with a random number below 2. We set the resulting list of lists to the LoL variable using the setq function.
 
Finally, we use the mapcar function to apply the reduce function to the each of the lists in LoL to get their sum.
 

LandOfLisSourceCode







An example result of the program above :
 
(print LoL)
((4 0 0 8 0) (1 8 1 4 1) (4 0 0 0 4) (2 0 2 1 1) (6 1 2 1 1))
(mapcar (lambda (x) (reduce #'+ x)) LoL)
(12 15 8 6 11)
 
Some Lisp resources:
Document Actions
Log in


Forgot your password?
New user?
Mailing List

Please click here to sign up or edit your subscription.