Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

From Steve Yegge's "Lisp is Not an Acceptable Lisp":

 Lisp has a little syntax, and it shows up occasionally as, for instance, '(foo)
 being expanded as (quote foo), usually when you least expect it.

What is he talking about with '(foo) being expanded into (quote foo) in some situations? (As opposed, I would imagine, to (quote (foo))).

share|improve this question

3 Answers 3

up vote 5 down vote accepted

I don't know. I cannot think of any situation where '(foo) would be turned into (quote foo) since it's actually tyhe same as (quote (foo)) (the ' symbol is typically a reader macro that reads the next sexp and returns it surrounded by a call to the quote special form).

share|improve this answer

In PicoLisp, '(foo) is equivalent to (quote foo) and 'foo is equivalent to (quote . foo).

I didn't understand that paragraph either. It's conceivable that Yegge was referring to PicoLisp (in the context of porting between Lisp dialects), or he could have been referring to a bug or corner case in a CL or Scheme implementation (though none that I am aware of.)

share|improve this answer
    
I suspect he just happened to typo a bit. –  Vatine Nov 2 '12 at 14:10

'(foo) is not "expanded" into (quote foo). The two forms are precisely the same; the lisp reader READS '(foo) as (quote foo).

To think they are somehow different is to completely misunderstand how lisp reads forms internally.

share|improve this answer
8  
No, the lisp reader reads 'foo as (quote foo) and '(foo) as (quote (foo)). –  Vatine Oct 29 '12 at 14:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.