On Thu, Feb 13, 2014 at 8:52 AM, Steven G. Johnson <[email protected]>wrote:
> You could also define: > > test(s::Symbol) = ....whatever.... > test(s::Any) = test(convert(Symbol, s)) > > which will accept any type that can be converted to Symbol, and throw a > MethodError otherwise. If you want to be a little more restrictive, you > can change Any to Union(String, other types, ...). > Yes this is possible - but it just transplants you into automatic-conversion-land. I'm looking for something where I note that I know there is a conversion taking place (:>Int64) so things don't happen without me acknowledging the extra conversion work, but without the syntax overhead of having convert() everywhere.
