[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



CC: GLS at MIT-AI, (BUG LISPM) at MIT-AI, nil at MIT-MC

    Date: 21 June 1980 00:31-EDT
    From: Daniel L. Weinreb <DLW at MIT-AI>

    The FORLIST (et al) idea sounds good except that the name
    FOR rather than DO does not particularly suggest the
    functionality of returning a list.  The existing precedent
    in the naming of the mapping functions is not too helpful either,
    unfortunately.

I agree.  Better names are solicited.  (Having the word
MAP in the name would be ideal, but lead to confusion with
the existing MAP functionals.)

Actually, it's not obvious whether FORARRAY should return
a list of results or an array of results!  The one I use
returns a list, but...

I might suggest the series of names
	[LIST-|ARRAY-|<empty>]DO[LIST|ARRAY|TIMES|PACKAGE|...]
the prefix indicating the kind of result returned, and the
suffix the thing iterated over; thus
	FORLIST => LIST-DOLIST
	FORARRAY => LIST-DOARRAY
	FORARRAY returning an array => ARRAY-DOARRAY
(LIST-DOTIMES (I N) I) produces (0 1 2 ... N-1): the APL iota function.
DOPACKAGE would be the DOLIST equivalent of MAPATOMS.  There could
be others.