Re: Cheaper to prepend or append an item to a sequence
On Tue, Feb 22, 2011 at 8:32 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote: > Even with a forward-chained list, you can implement append without copying > if you choose, at least for the first append operation to a given list > (which 9 times out of 10 will be the only append operation). How is that? If I have X=[1,2,3] ; Y=X ; Z=Y++ How can Z append Y without copying it first? You of course cannot modify Y in FP at all (which you know), much less w/o changing X. I'm confused.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format