Subject: Re: What is expensive about consing
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 10 Sep 2008 02:10:35 -0500
Newsgroups: comp.lang.lisp
Message-ID: <JpOdnQtEErJ271rVnZ2dnUVZ_qfinZ2d@speakeasy.net>
Pascal J. Bourguignon <pjb@informatimago.com> wrote:
+---------------
| awhite <spudboy@iinet.net.au> writes:
| > Rob Warnock wrote:
| >> Plus, it would improve improve portability, since the above is
| >> almost as easy to type as (APPLY #'+ NUMBER-LIST), and would
| >> thus discourage that latter, unsafe-for-portability practice.
| >
| > how is (APPLY #'+ NUMBER-LIST) unportable? To my novice eyes
| > it looks very elegant.
| 
| Because of call-arguments-list.  The portable form is:
| 
| (if (< (length number-list) call-arguments-limit)
|     (apply (function +) number-list)
|     (reduce (function +) number-list))
+---------------

Yup. What Pascal said...  ;-}

That's why I keep suggesting[1] that slightly-enhanced CL:REDUCE.


-Rob

[1] Well, A quick search shows that I've only suggested it about
    four times (1998, 2003, 2004, 2008). Note that previously I
    suggested that the new keyword be called :MAX-ARGS rather
    than :MAX-ARITY -- I have no clue why I went with the latter
    this time. Doing an APROPOS in CMUCL suggests that :MAX-ARGS
    would probably be a better choice.

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