[Ecls-list] remarks on git HEAD, 1b808f229076..
Tobias C. Rittweiler
tcr at freebits.de
Fri May 7 21:17:43 UTC 2010
Juan Jose Garcia-Ripoll writes:
> On Fri, May 7, 2010 at 11:00 PM, Tobias C. Rittweiler <tcr at freebits.de>wrote:
>
>>
>> * the compiler macros for aref and aset seem to have debugging stuff
>> left.
>>
>
> I know, it is waiting in my hard disk due to an interrupted commit. I will
> upload it when I solve the problems.
>
>
>> * with-clean-symbols is broken.. source code is not necessarily a tree,
>> so trying to use sublis on it is not enough.
>> Isn't with-clean-symbol just with-unique-symbols?
>>
>
> The purpose of this macro is not to be of general use. It is a simple hack
> that avoids using gensym / gentemp every time a macro is expanded and it
> does so only in the body of the macro.
>
> (defmacro blah-blah (...)
> ...
> (with-clean-symbols (%array-index)
> `(let ((%array-index ,index))
> (declare (:read-only %array-index))
> ,(expansion a '%array-index))))
> )
>
> this rewrites the inner body replacing %array-index with an uninterned
> symbol making the resulting expansion hygienic or "clean" in the sense that
> it will never collide with user's symbols. The body is always a tree or at
> least the places where we want to substitute the symbols are, and again,
> this is just for use in the compiler where I know that there will be no
> circular structures and nothing complicated, not a general tool.
Sure but why not just use with-unique-names? People reading
with-clean-symbols will wonder what it does, and those familiar to
with-unique-name (or with-gensyms) will wonder why you don't use one of
those.
In fact, Alexandria contains a bunch of useful stuff. Actually I wanted
to help polishing it up, so implementators can take and include it like
they include ASDF.
-T.
More information about the ecl-devel
mailing list