Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is ' (apostrophe) in Lisp / Scheme?

I am on day 1 hour 1 of teaching myself Scheme. Needless to say, I don't understand anything. So I'm reading The Little Schemer and using this thing:

http://sisc-scheme.org/sisc-online.php

as an interpreter.

I need to use ' in for example

(atom? 'turkey) 

to avoid an "undefined variable" error. The ', according to the book, is a Common Lisp thing.

I have two questions:

  1. Is the interpreter I mentioned above a good one? Can you recommend another? I need one that will go well with The Little Schemer.

  2. What is '?

like image 619
jjerms Avatar asked Oct 08 '09 16:10

jjerms


People also ask

What is an apostrophe in Lisp?

Because quote is used so often in programs, Lisp provides a convenient read syntax for it. An apostrophe character (' ' ') followed by a Lisp object (in read syntax) expands to a list whose first element is quote , and whose second element is the object.

What does apostrophe do in racket?

Produces a constant value corresponding to datum (i.e., the representation of the program fragment) without its lexical information, source location, etc. Quoted pairs, vectors, and boxes are immutable.

What is a symbol in Lisp?

Advertisements. In LISP, a symbol is a name that represents data objects and interestingly it is also a data object. What makes symbols special is that they have a component called the property list, or plist.

What is the difference between Lisp and Scheme?

Scheme is a dialect of Lisp that stresses conceptual elegance and simplicity. It is specified in R4RS and IEEE standard P1178. (See the Scheme FAQ for details on standards for Scheme.) Scheme is much smaller than Common Lisp; the specification is about 50 pages, compared to Common Lisp's 1300 page draft standard.


1 Answers

The form 'foo is simply a faster way to type the special form

(quote foo) 

which is to say, "do not evaluate the name foo replacing it with its value; I really mean the name foo itself".

I think SISC is perfectly fine for exploring the exercises in TLS.

like image 167
Jonathan Feinberg Avatar answered Sep 17 '22 14:09

Jonathan Feinberg