From: Florian Frank Date: 2007-10-24T04:40:57+09:00 Subject: Re: Why don't we have "C" machines? (was Re: [OT] Re: Should *most* memory be release back to the system?) Chad Perrin wrote: >> a. Lexical scoping. Both Common Lisp and Scheme are lexically scoped, >> but Lisp 1.5 was dynamic. >> b. There ain't no "evalquote" any more -- it's "read - eval - print". >> c. Scheme treats "nil" as true. >> > Point C really throws me. I guess my Ruby bias is showing. > I think you misunderstood the sentence. In Lisps nil is the empty list (= the last element of a recursive list), and in ordinary Lisps it's THE false constant at the same time. In Scheme the empty list is a true value like Ruby's empty array, but there are also literal constants #t for true and #f for false, while there is only a symbolic T constant for true in ordinary Lisps. So if you would write (defun sum (l) (if (not l) 0 (+ (car l) (sum (cdr l))))) in Common Lisp, you would have to write (define (sum l) (if (null? l) 0 (+ (car l) (sum (cdr l))))) in Scheme. Of course you could shorten the Common Lisp version to: (defun sum (l) (if l (+ (car l) (sum (cdr l))) 0)) But in Common Lisp it's more common (ha!) to use the loop construct (loop for i from 1 to 3 sum i) because it's not required for Common Lisps to have tail call optimization. In general Ruby's kind of nil (as an undefined "value") doesn't come up very much in Scheme (or the other Lisps), because all variables have to be explicitly bound to a value for a scope if you want to access them. -- Florian Frank