On Wed, Apr 20, 2016 at 2:54 PM, Yichao Yu <yyc1...@gmail.com> wrote:
> On Wed, Apr 20, 2016 at 2:33 PM, Didier Verna <did...@didierverna.net> wrote:
>> I wrote:
>>
>>> Could someone explain what's hygienic about Julia's macros? Because I
>>> cannot figure out an example by myself...
>>
>>   OK, I think I get it:
>>
>> julia> macro finish()
>>          t = 5
>>        end
>>
>> julia> function foo()
>>          t = 10
>>          @finish()
>>          t
>>        end
>> foo (generic function with 1 method)
>>
>> julia> foo()
>> 10
>>
>>
>> Still, it seems to me extremely abusive to call this macro system
>> hygienic...
>
> There's https://github.com/JuliaLang/julia/issues/14893
> Your macro is also simply returning a `5` btw.

Just to be clear, the behavior you observer is correct and expected.
Non-escaped variables used in macro is not supposed to affect the user
of the macro. The bug report I pasted is merely a FYI since you are
getting very closed to discover it.

>
>>
>> --
>> ELS'16 registration open! http://www.european-lisp-symposium.org
>>
>> Lisp, Jazz, Aïkido: http://www.didierverna.info

Reply via email to