From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "achambers.home@googlemail.com" Newsgroups: gmane.emacs.help Subject: Re: Effective use of destructive functions Date: 12 Apr 2007 08:27:48 -0700 Organization: http://groups.google.com Message-ID: <1176391668.711687.159240@n76g2000hsh.googlegroups.com> References: <1176334962.373893.13990@w1g2000hsg.googlegroups.com> <877isikq10.fsf@voyager.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1176392225 22257 80.91.229.12 (12 Apr 2007 15:37:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2007 15:37:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 12 17:36:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hc1Lm-0000Iy-GZ for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2007 17:36:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hc1Pw-0005ws-6s for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2007 11:41:00 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!out01b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!n76g2000hsh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 217.155.237.94 Original-X-Trace: posting.google.com 1176391669 31469 127.0.0.1 (12 Apr 2007 15:27:49 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 12 Apr 2007 15:27:49 +0000 (UTC) In-Reply-To: <877isikq10.fsf@voyager.informatimago.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: n76g2000hsh.googlegroups.com; posting-host=217.155.237.94; posting-account=OOX4TQ0AAADlkVZCWJTQRIpMj0KSWHiw Original-Xref: shelby.stanford.edu gnu.emacs.help:147014 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42618 Archived-At: On 12 Apr, 08:31, Pascal Bourguignon 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