Thanks for your help, but it works, but i have another problem, accidentally i opened a new post,
here is the link including a ccall and type definition in a macro: https://groups.google.com/forum/#!topic/julia-users/jDayl3Wx8uU. I followed the game you suggested but something is fishy i guess. On Tuesday, October 20, 2015 at 12:02:37 PM UTC-7, julia...@gmail.com wrote: > > Hi fellows, > > Question 1: > > I am trying to generate a type in a macro and expect to see it in the > calling context. > this is what i am doing in the macro: > code = quote eval(parse(string("type ", $(priv_typname), " end"))) end > > here is what is returned from the macro > eval(parse(string("type ",$(Expr(:escape, "priv_Eq"))," end"))) > > but in the julia shell, when i try to do this : > > julia> a = priv_Eq() > ERROR: UndefVarError: priv_Eq not defined > > can somebody tell me why and what I am doing wrong? > > > Question 2: > > I am also trying to generate a parametrized type like: > > type Eq{T,S} > end > > any suggestions to append the type_params to the type programmatically? > > Thanks > > > > > >