[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
n-ary functions rfc
From: Pavel Curtis <Pavel@parc.xerox.com>
Date: Fri, 12 Jun 1992 14:56:19 PDT
* Procedures are a more fundamental data type in Scheme than lists are;
we have special expressions for creating and using them. Aside from
history, the choice of lists for the representation of extra
arguments seems not just arbitrary, but foolish: vectors are clearly
more efficient to allocate, initialize, and access, regardless of the
order of the accesses.
First of all, optional arguments are not the only place in Scheme
where lists have special status. If you want to eliminate list's
special uses you will have to eliminate APPLY, MAP, and FOR-EACH or
make vector, string, and record versions as well. EVAL, which is in
many scheme implementations also is defined in terms of lists. The
fact that Scheme code can be parsed and written by READ, WRITE, and
LOAD also gives lists special status.
In fact, the connection between data structure and program structure
is one of the most powerful features of functional languages. I do
not want to see that connection removed.
As for the appropriatness of lists to representing multiple arguments,
They have the property of easy addition (CONS) and removal (CDR) which
I often use with APPLY. Vectors would require lots of copying to
accomplish the same things. I think lists are very well suited for
multiple arguments.