Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- julia> dostuff(a::Real) = println(2*a);
- julia> dostuff(2.0);
- 4.0
- julia> dostuff(2);
- 4
- julia> dostuff("2");
- ERROR: MethodError: no method matching dostuff(::String)
- Closest candidates are:
- dostuff(::Real) at REPL[1]:1
- Stacktrace:
- [1] top-level scope at none:0
- julia> domorestuff(a::Float64) = printlnt(2*a);
- julia> domorestuff(2);
- ERROR: MethodError: no method matching domorestuff(::Int64)
- Closest candidates are:
- domorestuff(::Float64) at REPL[5]:1
- Stacktrace:
- [1] top-level scope at none:0
Add Comment
Please, Sign In to add comment