[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: email@example.com
- Subject: Re: Apply
- From: firstname.lastname@example.org (Bill St. Clair)
- Date: Wed, 12 Aug 1992 13:52:59 -0500
- Cc: info-mcl
>Date: Wed, 12 Aug 92 11:59:16 CDT
>Subject: Re: Apply
>Organization: Dept of Computer Science, The Univ of Chicago
>In article <9208121537.AA03113@cambridge.apple.com> you write:
>>(defun make-menu-items (items)
>> (let (menu-items)
>> (dolist (item items)
>> (push (make-instance ...
>> #'(lambda (window)
>> (declare (ignore window))
>> (print item)))
>Bill, I almost posted this exact code fragment, but then I thought of
>the buggy code that Rao posted the other day, and I couldn't remember
>whether dolist was guaranteed to create a fresh binding for each
>iteration. Does your code create an :attached-function that, for each
>of the menu items, prints the value taken on by ITEM during the last
>iteration of the DOLIST?
As pointed out by Kim Barrett and Bob Cassells, my code is wrong.
You need to create a fresh binding or use a mapping function.