Search code examples
lispsicp

I'm reading SICP and trying to follow along, but why do the Lisp interpreters I find online fail with the DEFINE keyword?


This is the book...

http://mitpress.mit.edu/sicp/full-text/book/book.html

Any idea which interpreter I should use to work with the code presented here?

So far I have tried a few online and download Lisp interpreters and all I get is errors when I try to use DEFINE.

Example:

From this section: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1

Put in here: http://www.ugcs.caltech.edu/~rona/tlisp/

> (define (square x) (* x x))
*** EVAL Error: Function 'DEFINE' is not defined. ***

Also tried with 'lispbox' with similar results.

Ah HA: http://sisc-scheme.org/sisc-online.php works, thanks for the tip blabla999, will accept answer soon.

Upon further research: Scheme != Common Lisp


Solution

  • probably because:

    (EQ Scheme CommonLisp) -> #f

    and also:

    (EQ Scheme ManyOtherLisps) -> #f

    try a real scheme (I recommand plt, which has been renamed to Racket, recently). (Or write your own - see http://www.avc-cvut.cz/avc.php?id=9769)