[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Effective use of destructive functions
From: |
address@hidden |
Subject: |
Re: Effective use of destructive functions |
Date: |
12 Apr 2007 08:27:48 -0700 |
User-agent: |
G2/1.0 |
On 12 Apr, 08:31, Pascal Bourguignon <p...@informatimago.com> wrote:
> (let ((result (make-list 10 0)))
> (print (map-into result (function +) '(1 2 3 4 5 6)
> '(100 200 300 400 500 600 700 800)))
> (print (map-into result (function *) result '(2 2 2 3 3 3)))
> (map-into result (lambda (x) (+ 1000 x)) result))
>
> (101 202 303 404 505 606 0 0 0 0)
>
> (202 404 606 1212 1515 1818 0 0 0 0)
> (1202 1404 1606 2212 2515 2818 1000 1000 1000 1000)
I'm starting to think that it might be easier to keep a handle on the
root widget then transform that back into the xml tree whenever you
need to actually write it out to a file. That seems like the more
functional
way to do it.
Cheers,
Andy