`quote ... end` (or `:(...)` for shorthand) can be used to create
expression objects that are equivalent when eval'd to executing the
expression directly. from there, you can explore the resulting Expr tree
with dump() and Meta.show_sexpr() to observe the correct expression tree.

you can convert symbols to values with eval() or getfield()


On Mon Jan 26 2015 at 8:16:20 AM Tamas Papp <[email protected]> wrote:

> Suppose I have a trivial module
>
> module Foo
> x = 1
> end
>
> so names(Foo) now includes a Symbol that is === to symbol("x"). I have
> two questions:
>
> 1. How can I intern symbols into a module programatically, possibly from
> outside the module? symbol("Foo.y") does not work (using 3.5).
>
> 2. Similarly, how can I unintern symbols? Is this even possible in
> Julia? This would be relevant for redefining types.
>
> Thanks,
>
> Tamas
>
>
>

Reply via email to