Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace UTF32String usage for Julia 0.3 & type-stability #613

Closed
stevengj opened this issue May 30, 2014 · 1 comment
Closed

replace UTF32String usage for Julia 0.3 & type-stability #613

stevengj opened this issue May 30, 2014 · 1 comment

Comments

@stevengj
Copy link

The UTF32String constructor semantics are likely to change in Julia 0.3 (and this identifier was not defined in Julia 0.2); see JuliaLang/julia#7016

However, there is an easy fix (compatible with Julia 0.2) which has the added benefit of making your makeidentifier function type-stable. Just replace

cs = UTF32String(res)

with cs = utf8(res).

This will give you type stability, since you subsequently return in(cs, RESERVED_WORDS) ? "_"*cs : cs, and "_"*cs gives a bytestring even if cs is a UTF32String. If cs is a UTF8String, this will always return a UTF8String.

@johnmyleswhite
Copy link
Contributor

Closed by 7ee7651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants