julia> qn = :(:n) 
:(:n) 

julia> ex = :("My docstring about n, which has value $($qn))") 
:("My docstring about n, which has value $(:n))") 

julia> dump(ex) 
Expr 
 head: Symbol string 
 args: Array{Any}((3,)) 
   1: String "My docstring about n, which has value " 
   2: QuoteNode 
     value: Symbol n 
   3: String ")" 
 typ: Any 

julia> dump(qn) 
QuoteNode 
 value: Symbol n

--Tim

On Sunday, August 28, 2016 12:27:02 AM CDT Spencer Russell wrote:
> the metaprogramming docs say that `quote…end` produces a `QuoteNode`, but
> when I try:
> 
> julia> quo = quote
>        x=2
>        y=3
>        end
> quote  # none, line 2:
>     x = 2 # none, line 3:
>     y = 3
> end
> 
> julia> noquo = :(
>        x=2;
>        y=3)
> quote
>     x = 2
>     y = 3
> end
> 
> and `dump` the results, they both seem the same except for the presence of
> line number nodes in the `quote…end` one (on 0.4.6 and 0.5). Is there
> something else that creates the `QuoteNode`?
> 
> Thanks,
> Spencer


Reply via email to