<p dir="auto">Hello Julia Dev Team,</p>
<p dir="auto">please implement the ability to access the sourcecode of a function by typing in the<br>
function name. R has this ability and it is incredibly helpfull to read good, performant code<br>
and understand the system.<br>
Article about the matter:<br>
<a href="http://dorophone.blogspot.de/2011/07/duckspeak-vs-smalltalk.html" rel="nofollow">http://dorophone.blogspot.de/2011/07/duckspeak-vs-smalltalk.html</a></p>
<p dir="auto">regards 0x75</p>
<p dir="auto">Julia has a lot of useful REPL things like <code class="notranslate">methods</code> and <code class="notranslate">help</code>.<br>
However, I still end up needing to just look at the code to see what it's doing.<br>
It would be cool to be able to do:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; methods(base)
# methods for generic function base
base(base::Integer,n::Integer,pad::Integer) at intfuncs.jl:290
base(symbols::Array{Uint8,N},n::Integer,p::Integer) at intfuncs.jl:291
base(base_or_symbols::Union(Integer,Array{Uint8,N}),n::Integer) at intfuncs.jl:292

julia&gt; implementation(base,1)
base(base::Integer, n::Integer, pad::Integer) = _base(dig_syms,int(base),unsigned(abs(n)),pad,n&lt;0)

julia&gt; implementation(base,3)
base(base_or_symbols::Union(Integer,Array{Uint8}), n::Integer) = base(base_or_symbols, n, 1)"><pre class="notranslate"><code class="notranslate">julia&gt; methods(base)
# methods for generic function base
base(base::Integer,n::Integer,pad::Integer) at intfuncs.jl:290
base(symbols::Array{Uint8,N},n::Integer,p::Integer) at intfuncs.jl:291
base(base_or_symbols::Union(Integer,Array{Uint8,N}),n::Integer) at intfuncs.jl:292

julia&gt; implementation(base,1)
base(base::Integer, n::Integer, pad::Integer) = _base(dig_syms,int(base),unsigned(abs(n)),pad,n&lt;0)

julia&gt; implementation(base,3)
base(base_or_symbols::Union(Integer,Array{Uint8}), n::Integer) = base(base_or_symbols, n, 1)
</code></pre></div>
<p dir="auto">It's kind of like the jump-to code stuff in some IDEs, but in the REPL, and only showing the one function.<br>
This obviously has limitations, since you can't just scroll up and see the implementation of <code class="notranslate">_base</code> or search for the definition of <code class="notranslate">dig_syms</code> in that file, but it does let you see what the default values are.</p>
<p dir="auto">You can already see the signature for <code class="notranslate">_base</code>, which makes the implementations of <code class="notranslate">base</code> more meaningful. (without needing to switch from the REPL to a text editor)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; methods(Base._base)
# methods for generic function _base
_base(symbols::Array{Uint8,N},b::Int32,x::Unsigned,pad::Int32,neg::Bool) at intfuncs.jl:278"><pre class="notranslate"><code class="notranslate">julia&gt; methods(Base._base)
# methods for generic function _base
_base(symbols::Array{Uint8,N},b::Int32,x::Unsigned,pad::Int32,neg::Bool) at intfuncs.jl:278
</code></pre></div>
<p dir="auto">Considering that the line numbers/files are already included in the output of <code class="notranslate">methods</code>, it seems like it should be straightforward to grab the appropriate lines of code from the file.</p>