Julia: isascii was left behind in the Unicode move

Created on 14 Dec 2017  路  8Comments  路  Source: JuliaLang/julia

On 0.6:

julia> isascii
isascii (generic function with 2 methods)

On 0.7.0-DEV.2949:

julia> isascii
ERROR: UndefVarError: isascii not defined

julia> Base.isascii
ERROR: UndefVarError: isascii not defined

julia> Unicode.isascii
ERROR: UndefVarError: isascii not defined

julia> Base.Unicode.isascii
isascii (generic function with 2 methods)

Seems like it should be defined in the Unicode stdlib package and have a deprecation message.

stdlib unicode

Most helpful comment

Woops, looks like I stopped half-way... Yes, we could keep it in Base (actually I think I suggested that in the PR), since it's not really a Unicode function. Also it's special because it's the only predicate which accepts a string argument, and not only a Char.

All 8 comments

I wonder if we shouldn't just leave isascii in Base? It's not like its meaning is going to change.

Woops, looks like I stopped half-way... Yes, we could keep it in Base (actually I think I suggested that in the PR), since it's not really a Unicode function. Also it's special because it's the only predicate which accepts a string argument, and not only a Char.

Ok, let's just reinstate it to Base then.

See https://github.com/JuliaLang/julia/pull/25076.

However, regarding a more general rule to decide which functions should live in Unicode, note that isdigit and isxdigit do not depend on changes in the Unicode standard either, so they could be kept in Base by that rule. Same for isvalid IIUC.

Those all seem reasonable to me. We may want to rename isxdigit to ishexdigit while we're at it, to avoid being quite as cryptic, although the name isxdigit is quite ubiquitous, unfortunately.

Hi, why I`ve got the same error with variable name beginning with \partial unicode?

Please post questions to the Julia discourse discussion forum.

Was this page helpful?
0 / 5 - 0 ratings