Hi!

I'm confused with this...

When do I need to use Symbol instead of ASCIIString on function arguments? 

Which of the following is the best and Julian definition?


julia> myfunstr{T}(x::T; method::ASCIIString="one") = method=="one" ? one(T
)+x : x
myfunstr (generic function with 1 method)


julia> myfunsym{T}(x::T; method::Symbol=:one) = method==:one ? one(T)+x : x
myfunsym (generic function with 1 method)


julia> myfunstr(10)
11


julia> myfunsym(10)
11


Thanks in advance,
Best

Reply via email to