Inspired by How about to simplify the factorial function name? - #15 by cormullion.
Say I want to define !(x) = factorial(x)
. I can do that in a module
julia> baremodule M
import Base
!(x) = Base.factorial(x)
Base.@show !5
end
!5 = 120
but I can’t do it in the repl:
julia> !(x) = factorial(x)
ERROR: error in method definition: function Base.! must be explicitly imported to be extended
I don’t want to extend Base.!
, so the advice it gives is not relevant. Is it possible to define !
in the repl? Can I have a bare
repl?