For functions defined in the package, you can use less or @less . The first takes the name of the function (and returns the first definition, which does not have to be the one you need), the last, the function call.
less(less)
But this will not work with functions that you defined yourself in REPL. You can use code_typed for them, but it only returns the AST (abstract syntax tree) of your code, which is less readable. You also need to specify the type of arguments, because there can be several functions with the same name: you can get them using methods .
f(x::Number) = x + 1 f(x::AbstractArray) = length(x) methods(f)
Vincent zoonekynd
source share