On Thu, Jan 31, 2008 at 10:08:48PM -0800, Andrew Lentvorski wrote:
David Brown wrote:
On Thu, Jan 31, 2008 at 01:35:56PM -0800, Andrew Lentvorski wrote:
James G. Sack (jim) wrote:
What about
(1 . 2 3)
maybe: [1, [2, [3,nil]]] .. (there it is again!)
No. (1 . 2 3) is "Not valid".
DOT indicates a pure pair. It must have exactly one sexpr on the left
and exactly one sexpr on the right.
Well, not quite.
(1 2 . 3) is perfectly valid.
You moved the dot.
(1 . 2 3) != (1 2 . 3)
Intentionally, though. I was commenting about the "It must have exactly
one sexpr on the left and exactly one sexpr on the right." Which is true,
but due to the implicit grouping of list notation, you can have an almost
ordinary list with a dot before the last element.
It was helpful for me to see how implicit lists are expanded:
(1 2 3) === (1 . (2 . (3 . ())))
(1 2 . 3) === (1 . (2 . 3))
(Scheme doesn't have 'nil').
David
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg