Re: defsystem & eval

Marco Antoniotti <[email protected]> Thu, 18 Aug 2005 22:42:56 -0400
Newsgroups gmane.lisp.clocc.devel
Message-ID <[email protected]>
On Aug 18, 2005, at 5:33 PM, Sam Steingold wrote:

>> * Marco Antoniotti <[email protected]> [2005-08-18 17:21:08 -0400]:
>>
>> On Aug 18, 2005, at 5:07 PM, Sam Steingold wrote:
>>
>>>> * Marco Antoniotti <[email protected]> [2005-08-18 15:45:00 -0400]:
>>>>
>>>> I see not other way but to revert to the previous version.
>>>
>>> you can replace (eval foo) with
>>> (typecase foo
>>>  (function (funcall foo))
>>>  (otherwise (eval foo)))
>>> this will work for the top-level cases.
>>
>> Ok.  But what do you gain with this?  You can write
>>
>> 	:finally-do #'foo
>>
>> instead of
>>
>> 	:finally-do (foo)
>>
>> ?
>
> I am not sure I understand you.
>
>
>> Is that all?
>
> look at cllib.system:
>
> (let (x)
> (defsystem ...
>   :initally-do (setq x 1)
>   :finally-do (print x))
> )
>
> replacing (setq x 1) with (lambda()(setq x 1)) will not eliminate
> compilation warnings.

A simple workaround is to declare X (or TBC in cllib.system) SPECIAL.

That should do it as EVAL uses the current dynamic environment.

Cheers

Marco



--
Marco Antoniotti					http://bioinformatics.nyu.edu
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf