You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Julia's dispatch behavior is dependent upon which I call first. Note that the first (unused) argument is required to trigger this.
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+2494 (2014-04-04 23:25 UTC)
_/ |\__'_|_|_|\__'_| | Commit 7d495c0 (0 days old master)
|__/ | x86_64-apple-darwin13.1.0
julia> f(x,args...) = f(x,map(a->(isa(a,Type) ? Type{a} : typeof(a)), args))
f(x,t::(Type...)) = print(t)
f (generic function with 2 methods)
julia> f(1,(1,2)) # A dispatch loop to itself?
^CERROR: interrupt
in anonymous at none:1
in f at none:1 (repeats 1192 times)
julia> exit()
$ julia --quiet
julia> f(x,args...) = f(x,map(a->(isa(a,Type) ? Type{a} : typeof(a)), args))
f(x,t::(Type...)) = print(t)
f (generic function with 2 methods)
julia> f(1,(Int,)) # Call the second method first
(Int64,)
julia> f(1,(1,2)) # And now the first method works as expected!
((Int64,Int64),)
The text was updated successfully, but these errors were encountered:
If I define a function with the following methods:
Julia's dispatch behavior is dependent upon which I call first. Note that the first (unused) argument is required to trigger this.
The text was updated successfully, but these errors were encountered: