Programming Language for Old Timers

by David A. Moon
February 2006 .. September 2008

Comments and criticisms to dave underscore moon atsign alum dot mit dot edu.

Previous page   Table of Contents   Next page


The arguments in a function call are a comma-separated list of expressions.

To increase the readability of a call to a function that has keyword parameters, any argument expression can be preceded by a keyword. This becomes two arguments, the simple-name corresponding to the keyword and the value of the expression. The first argument typically selects the function parameter whose definition in the body of the function will be the second argument. Of course this syntax can be used in any function call, regardless of the parameter-list of the callee function.

In addition, any argument can be a sequence that is "spread" by the function call so that each element of the sequence becomes an individual argument. This is indicated by appending the particle ... to the argument expression.

The syntax could be defined by:

defparser argument-list { [ ?:keyword ] ?arg [ ??spread ... ] & ~^ , }* => ...

Previous page   Table of Contents   Next page