[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: setf'able?

William James

5/13/2015 9:40:00 AM

Barry Margolin wrote:

> > Err, why the REDUCE instead of an APPLY of append? REDUCE will
> > reinvoke APPEND with each intermediary result, which is promptly
> > "thrown away". Presumably APPEND can avoid all of these intermediate
> > throwaways by working the &rest list right to left.
>
> One reason why REDUCE is often used in favor of APPLY is that REDUCE
> doesn't have a limit on the number of entries in the list, but APPLY may be
> limited to CALL-ARGUMENTS-LIMIT total arguments in the underlying call.
>
> However, in the case of APPEND, the performance impact of REDUCE can be
> severe. A single call to APPEND should only need to traverse and copy each
> argument once, so it should be O(n). REDUCE of APPEND, on the other hand,
> will end up being O(n^2) in both space and time (although an ephemeral GC

Gauche Scheme:

Function: concatenate list-of-lists
Function: concatenate! list-of-lists!

[SRFI-1] Equivalent to (apply append list-of-lists) and (apply
append! list-of-lists), respectively, but this can be a bit
more efficient by skipping overhead of apply.

--
In Australia, in 2000, Bankstown and Greenacre (in Sydney) had a succession of
gang-rapes, in which the victims testified to the particularly gruesome details
of being assaulted by a dozen or more men at a time, screaming at them for
being "Aussies" or "Christians."
http://fjordman.blogspot.com/2005/08/rape-nothing-to-do-with-...