On Thursday, January 9, 2014 4:37:42 PM UTC-6, Brian Nguyen wrote:
>
> Types are first class objects. How to write anonymous types in Julia?


Never one to discourage bad ideas, I offer this old code (which I note 
didn't make the transition from extras/strpack.jl to StrPack.jl, the 
module):

function gen_type(types)
    @gensym struct
    fields = gen_typelist(types)
    typedef = quote
        type $struct
            $(fields...)
        end
        $struct
    end
    eval(typedef)
end


Reply via email to