/usr/share/julia/base/docs/bindings.jl is in julia-common 0.4.7-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # This file is a part of Julia. License is MIT: http://julialang.org/license
export @var
immutable Binding
mod::Module
var::Symbol
Binding(m, v) = new(Base.which_module(m, v), v)
end
function splitexpr(x::Expr)
isexpr(x, :macrocall) ? splitexpr(x.args[1]) :
isexpr(x, :.) ? (esc(x.args[1]), x.args[2]) :
error("Invalid @var syntax `$x`.")
end
splitexpr(s::Symbol) = :(current_module()), quot(s)
splitexpr(other) = error("Invalid @var syntax `$other`.")
isvar(x) = isexpr(x, [:macrocall, :.])
isvar(::Symbol) = true
macro var(x)
:(Binding($(splitexpr(x)...)))
end
Base.show(io::IO, x::Binding) = print(io, "$(x.mod).$(x.var)")
|