Hi,
I am having the following problem. Here is my code:
julia> macro myname(arg)
typname = esc(arg)
privtypname = esc(symbol(string("priv",arg)))
code = quote
typealias $(typname) ccall( (:clock, "libc"), Int32, ())
type $privtypname
a
end
end
return code
end
the error i get is : *ERROR: error compiling anonymous: type definition not
allowed inside a local scope*
Can anyone tell me what is wrong? The macroexpand code seems normal:
julia> macroexpand(:(@myname goox))
quote # none, line 5:
typealias goox ccall((:clock,"libc"),Int32,()) # none, line 6:
type privgoox # none, line 7:
a
end
end
thanks