2011-04-30

avoiding parentheticals for the lisp-allergic

4.9: mis.adda/syntax/semicolon-comma combination:
. (f x) can be extended with comma
if the semicolon is required for
terminating a function call;
this is good for avoiding paren's .
...
but then you can't tell whether
the ,,,; is for the fx
or for the list that contains the fx .
...
. in places that expect (;)
an optional comma-separated list is also possible;
conversely, in places where a commas delimit,
such as a list, or vector,
a semicolon provides a shortcut to lists of lists
(,,,;,,,) = ((,,,), (,,,)).
with semicolons as param terminators,
(f(,,,), g(,,,)) = (f,,,; g ,,,)
but that is confused with (f(); g())?
speaking of confusion,
if (,,,;,,,) = ((,,,), (,,,))
then you can't have sequences in param's?
you have to parenthesize them:
(,,,; ,,,) means a matrix;
(,,,(;),,,) means a list containing a sequence .
(,;
,,,;
,,) -- ragged array .
4.30: another way:
. after a symbol (whether a function or not)
if it's followed by a colon:
f:,,,; -- then it can terminated by a (;).

No comments:

Post a Comment