Subject: Re: Making structures useable
From: rpw3@rpw3.org (Rob Warnock)
Date: Fri, 27 Aug 2004 06:58:21 -0500
Newsgroups: comp.lang.lisp
Message-ID: <qfqdnfU1FqFAvLLcRVn-iw@speakeasy.net>
Andy Freeman <anamax@earthlink.net> wrote:
+---------------
| BTW - addition is conceptually nary.  Thus, the (reduce #'+ values)
| should be (apply #'+ values).
+---------------

Even if (> (LENGTH VALUES) CALL-ARGUMENTS-LIMIT)???
No, I thought not.  ;-}

Rather, what we really need is for implementors to add the :MAX-ARGS
keyword as an extension to REDUCE so that it can act like the Unix
shell command "xargs", that is, allow things like this:

    (REDUCE #'+ VALUES :MAX-ARGS 35)

which would internally APPLY the function argument successively
to length 34 (to account for the accumulated intermediate result)
subsequences of the sequence arg.

[Note: ":MAX-ARGS T" should probably mean "MAX-ARGS CALL-ARGUMENTS-LIMIT".]

[Note#2: I say "implementors", since while one could write a MY-REDUCE
that took such a :MAX-ARGS keyword and "did the right thing", it would
probably be much more efficient if were implemented in the base system.]


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607