Email or username:

Password:

Forgot your password?
Top-level
Ed Davies

@neauoire What's the difference between:

>

(QUOTE 12)

and just:

>

12

In my little Lisp, which is AFAIK, compatible with more-standard Lisps (like Scheme) in this regard:

>

ed@george:~/projects/sexpr/sexpr$ λ
>> 12
.. 
12
>> (quote 12)
.. 
12
>> '12
.. 
12
>> ''12
.. 
(quote 12)
>> 

3 comments
Devine Lu Linvega

@edavies 12 will try to find a function with that name, (QUOTE 12) is the value.

Ed Davies

@neauoire That's a big divergence from most Lisps, I think. They only look for a function at the head of a list. Without quote they'd resolve a symbol later in the list to its value but wouldn't try to execute it.

The very first bit of code shown in SICP (so Scheme) is (+ 137 349).

E.g., (MUL (QUOTE 2) (ADD (QUOTE 1) X)) could be more-simply written as (MUL 2 (ADD 1 X)) with the same effect.

Devine Lu Linvega

@edavies yeah for sure, I'm familiar with how lisp and scheme does that. This is quite a bit different. I might write a prelude that changes the compiler to handle this more gracefully, but as defined in Lispkit, pure lisp doesn't have any helpers for that.

Go Up