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-...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: setf'able?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password