Often times when I am exploring and building things with a new package I am frequently checking what methods are available in the REPL by doing
? SomeFunc. It will return something like
# 3 methods for generic function blah and then show a list of them with the corresponding line numbers in the source.
If there is a specific method I want to see the source for, is it possible print it out in the REPL? If so what command is used?
@edit. They’re super handy!
# 3 methods for generic function "println":
 println(io::IO) in Base at coreio.jl:5
 println(io::IO, xs...) in Base at strings/io.jl:73
 println(xs...) in Base at coreio.jl:4
println(xs...) in Base at coreio.jl:4
julia> edit(ans) # opens file at relevant line in text editor
Or more breifly,
julia> @edit println("this opens", [:the, :source], "in an editor")