Defining a struct in a different module

Hi i would like to do the following:


module DDF
end

struct DDF.XX
end

is there a way to do this?

Thanks

see below

The first argument to @eval or eval is the module in which you want evaluation to take place. So you actually can do what you’re asking for:

julia> module Foo; end
Foo

julia> @eval Foo struct Bar; end

julia> Foo.Bar()
Foo.Bar()
1 Like

thanks – it turns out I have a use for this :slight_smile: