sperber(a)informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor]) writes:
> Clemens> Where do I need explicit annotations? At definition time, I
> Clemens> say which hygienic variables I want. This is an explicit
> Clemens> annotation.
>
> And you have to write an unquote before every use. This means you
> have annotations everywhere.
Well, for me the usage of unquote in my examples was quite intuitive,
but I understand that other people may feel differently about this.
Actually, we have three definition and use times:
(1) Definition of define-hygienic-macro
(2) Use of define-hygienic-macro ... Definition of foo2
(3) Use of foo2
It is (2) which you complained about. In (3), the actual "use" time,
define-hygienic-macro works transparently.
> Clemens> On the other hand, I don't think that in Scheme you can say
> Clemens> you want this and that variable *not* to be hygienic.
>
> No, but (to quote Craig in this discussion :-}) why would you want
> this?
One example is LOOP-FINISH. From the HyperSpec:
----------------------------------------------------------------------
The loop-finish macro can be used lexically within an extended loop
form to terminate that form normally. That is, it transfers control
to the loop epilogue of the lexically innermost extended loop form.
This permits execution of any finally clause (for effect) and the
return of any accumulated result.
Examples:
;; Terminate the loop, but return the accumulated count.
(loop for i in '(1 2 3 stop-here 4 5 6)
when (symbolp i) do (loop-finish)
count i)
=> 3
----------------------------------------------------------------------
This is defined in the CL standard and I find it quite useful.
> Clemens> In CL you can have both behaviours, in Scheme only one.
>
> As I explained, in CL you only have the non-hygienic option. You can
> hack around it, but it's still not going to do the right thing in all
> cases.
Can you give an example where with-hygienic-variables fails? What is
"the right thing"?
Yours,
--
Clemens Heitzinger
Student der Techn. Mathematik, Technische Universität Wien, Österreich
Vienna University of Technology, Austria