hello, everyone,
I want to extract arguments type and defalut value from a Function, but method() only give part of arguement type and no defalut value which are defined by function.
function hello(name::String="world";greet::String="nice day")
println("hello $name, $greet")
end
methods(hello)
will output this:
2 methods for generic function hello:
hello(name::String; greet) in Main at In[6]:2
hello() in Main at In[6]:2
thanks very much~ then I tried this, it can get the name and greet default name, but no number argument.
function hello(name::String="world";greet::String="nice day",number::Int=3)
println("x")
end
methods(hello)
for m in methods(hello)
println(m.roots)
end