They seem have similar "code".
eg:
function fun(x::Int)
x
end
function fun(x)
x
end
fun.env.defs.func.code
AST(:($(Expr(:lambda, {:x}, {{},{{:x,:Any,0}},{}}, :(begin
return
end)))))
func2 = (x) -> x
func2.code
AST(:($(Expr(:lambda, {:(x::Any)}, {{},{{:x,:Any,0}},{}}, :(begin #
none, line 1:
return x
end)))))
And function has sig(signature?)
fun.env.defs.sig
(Any,)
I guess, a function has one name and many defs(definition?). And Julia will
do dispatch base on the "sig".
Is it right? Please correct me, if I made any mistakes. Please tell me more
about Julia function!
But how Julia do dispatch base on the "sig"? Where is the "function" code
in Julia source code?