* cons* and append!
@ 2004-02-13 19:18 Brian S McQueen
2004-02-13 20:05 ` Andreas Rottmann
2004-02-13 21:58 ` Stephen Compall
0 siblings, 2 replies; 3+ messages in thread
From: Brian S McQueen @ 2004-02-13 19:18 UTC (permalink / raw)
I few weeks back I asked abit about list building and I got some helpful
responses. The operator cons* was recommended to me. Well I noticed
append! yesterday. Does anyone have any comments on this? It seems an
excellent way of extending proper lists without copying or reallocating
elements, since it merely clobbers the trailing null list of one list and
inserts the car of the appended list in its place. Are there some hidden
expenses I am unaware of? Does it have to walk the entire length of the
first list to find the end?
I will look at the source code. I should've looked at it before I wrote
this, but comments would still be appreciated!
Brian
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cons* and append!
2004-02-13 19:18 cons* and append! Brian S McQueen
@ 2004-02-13 20:05 ` Andreas Rottmann
2004-02-13 21:58 ` Stephen Compall
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Rottmann @ 2004-02-13 20:05 UTC (permalink / raw)
Cc: guile-user
Brian S McQueen <bqueen@nas.nasa.gov> writes:
> I few weeks back I asked abit about list building and I got some helpful
> responses. The operator cons* was recommended to me. Well I noticed
> append! yesterday. Does anyone have any comments on this? It seems an
> excellent way of extending proper lists without copying or reallocating
> elements, since it merely clobbers the trailing null list of one list and
> inserts the car of the appended list in its place. Are there some hidden
> expenses I am unaware of? Does it have to walk the entire length of the
> first list to find the end?
>
Yes, append! will have to walk all the lists but the last. All you
save is copying them.
Andy
--
Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at
http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
Make free software, not war!
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cons* and append!
2004-02-13 19:18 cons* and append! Brian S McQueen
2004-02-13 20:05 ` Andreas Rottmann
@ 2004-02-13 21:58 ` Stephen Compall
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Compall @ 2004-02-13 21:58 UTC (permalink / raw)
Cc: guile-user
Brian S McQueen <bqueen@nas.nasa.gov> writes:
> I few weeks back I asked abit about list building and I got some
> helpful responses. The operator cons* was recommended to me. Well
> I noticed append! yesterday. Does anyone have any comments on this?
> It seems an excellent way of extending proper lists without copying
> or reallocating elements, since it merely clobbers the trailing null
> list of one list and inserts the car of the appended list in its
> place. Are there some hidden expenses I am unaware of? Does it
> have to walk the entire length of the first list to find the end?
Yes, it does. This is why we have (ice-9 q) instead of just appending
new cells to the end.
--
Stephen Compall or s11 or sirian
What you see is from outside yourself, and may come, or not, but is beyond
your control. But your fear is yours, and yours alone, like your voice, or
your fingers, or your memory, and therefore yours to control. If you feel
powerless over your fear, you have not yet admitted that it is yours, to do
with as you will.
-- Marion Zimmer Bradley, "Stormqueen"
JUWTF FBI threat corporate security bce Medco Aldergrove FTS2000 Nazi
clandestine PGP quarter CISU Croatian broadside
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-13 21:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-13 19:18 cons* and append! Brian S McQueen
2004-02-13 20:05 ` Andreas Rottmann
2004-02-13 21:58 ` Stephen Compall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).