Page 1 of 1

How to start programming in LISP

Posted: Mon Jan 05, 2009 11:26 am
by nitinkapoor25
Hi All,

I am new in LISP and need your help to start programming in LISP. I have read the basic of lisp about different commands. Please help me to start programming.

Thanks
Nitin

Re: How to start programming in LISP

Posted: Tue Jan 06, 2009 1:51 pm
by qbg
What lisp dialect (Common Lisp, Scheme, etc.) have you been reading up on? If you haven't been focusing on a specific one, then you should before you start writing code. If you need to pick one, Common Lisp might be a good choice.

If you are going to be doing CL, you might want to start reading Practical Common Lisp. You will also need to install a CL implementation (unless you already have one installed). For free software implementations, SBCL is very popular, though its support on Windows is a bit young (should work okay though nowdays). CLISP is another implementation which is nice, and is traditionally the free software implementation for Windows. You could also try Lispbox.

Re: How to start programming in LISP

Posted: Thu Jan 15, 2009 11:33 am
by nitinkapoor25
Thanks for your reponse.

I am using Ubuntu (Linux OS). I have already installed below mentioned software for lips:

1. EMACS GNU
2. SBCL
3. CL-SQL
4. Slime

I am trying the file opening in emacs LISP with below mentioned code:

(let ((in (open "/home/administrator/test.el")))
(format t "~a~%" (read-line in))
(close in))

I got T in reply. Didn't understand what it means.

waiting for reply.

Regards
Nitin

Re: How to start programming in LISP

Posted: Thu Jan 15, 2009 1:19 pm
by Exolon
Does it not simply mean that the file was closed successfully? (let form evaluates to its last subform, which is (close in), so that returns T (I presume is the emacs lisp equivalent of #t in Common Lisp, i.e. true)... right?)

Re: How to start programming in LISP

Posted: Wed Jan 21, 2009 2:23 pm
by Wodin
Exolon wrote:Does it not simply mean that the file was closed successfully? (let form evaluates to its last subform, which is (close in), so that returns T (I presume is the emacs lisp equivalent of #t in Common Lisp, i.e. true)... right?)
You're thinking of Scheme. T is true in Common Lisp (and I assume it's the same in Emacs Lisp.) Scheme uses #t and #f for true and false.

Re: How to start programming in LISP

Posted: Mon Jan 11, 2010 7:50 pm
by psismondi
For help learning Common Lisp such as sbcl, also check out David Lamkin's book (online and free):

http://www.psg.com/~dlamkins/sl/

My own favorite beginner's book is Paul Graham's ANSI Common Lisp. But it is not free.

Best,

- Phil -

Re: How to start programming in LISP

Posted: Wed Jan 13, 2010 10:23 am
by Paul Donnelly
nitinkapoor25 wrote:I am trying the file opening in emacs LISP with below mentioned code:

Code: Select all

(let ((in (open "/home/administrator/test.el"))) 
  (format t "~a~%" (read-line in)) 
  (close in))
This isn't Emacs Lisp, this is Common Lisp. Where did you type this? Have you got SLIME set up properly? If you have, you should see the first line of that file printed in your REPL, and then T, since "(close in)" returns T, and that's the last form in your let. It's better to use with-open-file than open/close if you can.