Show source code of function from repl
I would like to review the definition of a method in the REPL. I follow this link ( https://github.com/JuliaLang/julia/issues/2625 ) but it doesn't work:
julia> f(x) = x^2
f (generic function with 1 method)
julia> expand(f)
f (generic function with 1 method)
julia> methods(f)
# 1 method for generic function "f":
f(x) at REPL[155]:1
julia> implementation(f,1)
ERROR: UndefVarError: implementation not defined
in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
in macro expansion at ./REPL.jl:95 [inlined]
in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
The method implementation
doesn't seem to exist.
+3
source to share