JuliaLang/julia — pull request #7322 by mauro3 (2014-06-19 18:54:23+00:00)
Title: added reflection method

As far as I know, when using `using` it is not easy to find out which module a particular binding came from. At least when the object the binding points to does not contain that data, like for instance a variable.

This adds a method and a macro to do that:
```
julia> Base.@binding_module sin
Base

julia> Base.@binding_module a
ERROR: Symbol a is not bound in the current module Main and not exported in any 'used' module.
in error at error.jl:21
in binding_module at reflection.jl:171

julia> a = 4
4

julia> Base.@binding_module a
Main

julia> Base.binding_module(:a)
Main
```
If this is of interest, someone should have a look at the c-code! And I will add some test. Should it be exported? If so `function_module` should probably be exported too.