What is the difference between (12 15) and (12 . 15)?
Slapstiq
Hidayet Tunc Simsek <······@EECS.Berkeley.Edu> wrote in message
······················@EECS.Berkeley.Edu...
> (cons 12 15)
>
> Slapstiq wrote:
> >
> > What does ( 12 . 15 ) mean? Is it a list of 12 15? Im not sure what it
> > means.
> >
> > Thank you
> >
> > Slapstiq
In article <···················@typhoon.nyroc.rr.com>,
Slapstiq <········@rochester.rr.com> wrote:
>What is the difference between (12 15) and (12 . 15)?
(12 15) is a list. It's equivalent to (cons 12 (cons 15 nil)). (12 . 15)
is a single cons, equivalent to (cons 12 15). So the difference between
them is the difference between (15) and 15.
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
"Slapstiq" <········@rochester.rr.com> writes:
> What is the difference between (12 15) and (12 . 15)?
(12 15) is equivalent to (cons 12 (cons 15 nil)), while
(12 . 15) is (cons 12 15).
A LISP list is composed of a sequence of two-element
structures (cons cells) where one element (the 'car' element) contains
a value and the other element (the 'cdr' element) contains a reference
to the next cons cell in the sequence. The last cons cell in a
non-empty list contains nil; an empty list is simply represented by
the value nil.
--
Raymond Wiker, H�yveien 55, 4800 Arendal
+47 370 22965
In article <···················@typhoon.nyroc.rr.com>,
Slapstiq <········@rochester.rr.com> wrote:
>What does ( 12 . 15 ) mean? Is it a list of 12 15? Im not sure what it
>means.
It's a cons whose car is 12 and cdr is 15.
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.