On Wednesday, January 7, 2015 10:51:54 AM UTC+10, Ronald L. Rivest wrote:
>
> Using Julia 0.3.4. The following seems somehow inconsistent. Is there
> something about the philosophy of `convert` I am missing??
>
> *julia> convert(ASCIIString,'a')*
>
> *ERROR: `convert` has no method matching convert(::Type{ASCIIString},
> ::Char)*
>
Char is a Unicode codepoint so it cannot be guaranteed to be convertable to
ASCIIString. But you could argue that conversion to UTF8String (or other
unicodes) should work, but at least in 0.3.4 it doesn't.
Cheers
Lex
> * in convert at base.jl:13*
>
> *julia> string('a')*
>
> *"a"*
>
> *julia> typeof(ans)*
>
> *ASCIIString (constructor with 2 methods)*
>
> Cheers,
>
> Ron
>