(guile.info.gz) List Syntax
Info Catalog
(guile.info.gz) Lists
(guile.info.gz) List Predicates
22.2.1 List Read Syntax
-----------------------
The syntax for lists is an opening parentheses, then all the elements of
the list (separated by whitespace) and finally a closing
parentheses.(1).
(1 2 3) ; a list of the numbers 1, 2 and 3
("foo" bar 3.1415) ; a string, a symbol and a real number
() ; the empty list
The last example needs a bit more explanation. A list with no
elements, called the "empty list", is special in some ways. It is used
for terminating lists by storing it into the cdr of the last pair that
makes up a list. An example will clear that up:
(car '(1))
=>
1
(cdr '(1))
=>
()
This example also shows that lists have to be quoted (REFFIXME) when
written, because they would otherwise be mistakingly taken as procedure
applications ( Simple Invocation).
---------- Footnotes ----------
(1) Note that there is no separation character between the list
elements, like a comma or a semicolon.
Info Catalog
(guile.info.gz) Lists
(guile.info.gz) List Predicates
automatically generated byinfo2html