-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
utfxx vs. UTFxx #10456
Comments
I don't like guessing what a boolean parameter is supposed to mean. How about a |
This is a common pattern that I've run into with constructors, and maybe it deserves a common idiom… especially since the previous sortof-idiom (lower/upper-case) is on the way out. I often want to default to checking argument consistency in constructors, but need an escape hatch for internal code where I already know those arguments are consistent. It's a much harder problem than user-extensible +1 for the rename, we can bikeshed an |
There was talk of making an |
@quinnj, except that the unsafe constructor needs to be an inner constructor. @ivarne, because it is an inner constructor, I think that rules out any name but |
How does renaming all string types fit with @StefanKarpinski's rework of strings? Anywa, I'm not really fan of removing the |
@nalimilan, users are already writing I see this as orthogonal to Stefan's rework of |
@stevengj I was more concerned about users seeing Anyway, I guess my point is that the benefit isn't compelling, and the cost, while small, is not negligible. |
|
That's a fair point --- but nor is it obvious what the difference is between |
Made irrelevant by the removal of these names. |
In #10452, @JeffBezanson got rid of most of the lower-case numeric conversions, as discussed in #1470. In #1470, it was similarly suggested that
UTFxxString
be renamed toUTFxx
, and thatutfxx(s)
be eliminated in favor ofUTFxx(s)
. Most people seemed to be in favor of this?(One slight tweak is that
UTF16String(x::Array{UInt16})
is currently a low-level constructor that accepts a nul-terminated array, whereasutf16(x::Array{UInt16})
adds the nul terminator for you. However, this could be changed toUTF16(x::Array{UInt16}, addnul=true)
, so thatUTF16(x)
is the high-level version that adds the nul, whereasUTF16(x, false)
is the low-level version that requiresx
to already have the nul.)The text was updated successfully, but these errors were encountered: