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

Implementation of MAP, SOME, EVERY, etc...

    Received: by godot id AA28148; Wed, 27 Mar 85 22:11:41 est
    Received: from SU-AI.ARPA (su-ai.arpa.ARPA) by cca-unix.ARPA (4.12/4.7)
	    id AA24285; Wed, 27 Mar 85 21:34:41 est
    Received: from SCRC-STONY-BROOK.ARPA by SU-AI.ARPA with TCP; 27 Mar 85  13:39:50 PST
    Received: from SCRC-EUPHRATES by SCRC-STONY-BROOK via CHAOS with CHAOS-MAIL id 204367; Wed 27-Mar-85 16:16:13-EST
    Date: Wed, 27 Mar 85 16:17 EST
    From: David A. Moon <cca!Moon%SCRC-STONY-BROOK.ARPA@godot>
    Subject: Implementation of MAP, SOME, EVERY, etc...
    To: Dan Corkill <cork%umass-cs.csnet%CSNET-RELAY.ARPA@godot>
    Cc: common-lisp%SU-AI.ARPA@godot
    In-Reply-To: The message of 19 Mar 85 11:58-EST from Dan Corkill <cork%umass-cs.csnet@csnet-relay.arpa>
    Message-Id: <850327161712.2.MOON@EUPHRATES.SCRC.Symbolics.COM>
    Comment: Message remailed after delay caused by distribution list error.

	Date:     Tue, 19 Mar 85 11:58 EST
	From:     Dan Corkill <cork%umass-cs.csnet@csnet-relay.arpa>

	There is an easily made implementation error in MAP, SOME, EVERY, etc.
	The published semantics indicate that these functions use the length of
	the shortest argument sequence to determine how many iterations to 
	perform (and in this way parallel the semantics of mapc, mapcar, etc.).

	Thus it would appear that:

		(map 'list '+ '(1 2 3) (star 2))

	where star builds a circular list of its argument should be legal and
	return => (3 4 5).

	Implementations that use length to check the length of argument sequences
	will break on such a call.

    The Common Lisp LENGTH function returns NIL when given a circular list.