|
|
 |
 |
 |
 |
Scheme Programming Language
|
 |
 |
 |
 |
 |
 |
 |
 |
Was there a time when cons actually means list?
I'm reading some pages that explain macro : "http://infohost.nmt.edu/tcc/help/lang/lisp/intro.txt" It says: `(lambda ,(cdr (cons 'a 'b)) ,@(cdr (cons 'a 'b))) --> (lambda (b) b) but when I try it on several versions of scheme and clisp, it give a different result, or gives an error. I mostly get: `(lambda ,(cdr (cons 'a 'b)) ,@(cdr (cons 'a 'b))) --> (lambda b . b) `(lambda ,(cdr (list 'a 'b)) ,@(cdr (list 'a 'b))) --> (lambda (b) b) There must be some miscommunication, or some history here.
In article <1175745676.369278.116@n59g2000hsh.googlegroups.com>,
dillog @gmail.com wrote: > I'm reading some pages that explain macro : > " http://infohost.nmt.edu/tcc/help/lang/lisp/intro.txt" > It says: > `(lambda ,(cdr (cons 'a 'b)) ,@(cdr (cons 'a 'b))) > --> (lambda (b) b) > but when I try it on several versions of scheme and clisp, it give a > different result, or gives an error. > I mostly get: > `(lambda ,(cdr (cons 'a 'b)) ,@(cdr (cons 'a 'b))) > --> (lambda b . b) > `(lambda ,(cdr (list 'a 'b)) ,@(cdr (list 'a 'b))) > --> (lambda (b) b) > There must be some miscommunication, or some history here.
I think it's just a mistake on the web page. CONS and LIST have had pretty much their current specification since time immemorial. I suggest you notify the web page's author. -- Barry Margolin, bar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***
|
 |
 |
 |
 |
|