[swift-evolution] [Draft] Fix a typo in two String methods
Xiaodi Wu
xiaodi.wu at gmail.com
Sat Jul 23 19:09:09 CDT 2016
On Sat, Jul 23, 2016 at 5:29 PM, Andrew Trick via swift-evolution <
swift-evolution at swift.org> wrote:
>
> On Jul 23, 2016, at 3:21 PM, Andrew Trick via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>
> On Jul 23, 2016, at 3:16 PM, Chris Lattner <clattner at apple.com> wrote:
>
>
> On Jul 23, 2016, at 2:38 PM, Andrew Trick via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>
> On Jul 23, 2016, at 2:06 PM, Xiaodi Wu via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> On Sat, Jul 23, 2016 at 3:54 PM, Daniel Duan <daniel at duan.org> wrote:
> In the context of character sets, "nul" is the correct name for the 0
> value. "null" only makes sense when we are talking about pointer-like
> references.
>
> Oh, I see: "NUL-terminated" is a thing because "NUL" is the ASCII name.
> Still a little bizarre looking, though, especially if it's UTF8 rather than
> ASCII. I am less bothered by it now, thanks :)
>
>
> Yeah. Using the ASCII abbreviation was intentional but after thinking
> about it for a second I still think it should be renamed. Swift methods are
> supposed to be spelled out in english. There’s no reason to use an
> abbreviation here.
>
>
> “NUL” is an abbreviation for “Null Character”. You think that it is a
> good idea to spell out its full two-word name?
> https://en.wikipedia.org/wiki/Null_character
>
>
> I’ll take the troll bait. “nulTerminatedUTF8" should read
> “nullTerminatedUTF8” because
> 1. null-terminated is a common english phrase
> 2. the acronym is not recognizable lowercase and in the context of the
> above phrase
>
>
> :) Oops sorry, it’s not an acronym, but it never appears lowercase, or in
> the context of C strings for that matter.
>
I'm not entirely confident it was a great idea to raise this issue, but now
that we're having the discussion: NUL is of a kind with control codes BS,
CAN, CR, HT, LF, SP, DEL, the corresponding names being null, backspace,
cancel, carriage return, [horizontal] tab, line feed, space, and delete.
For most of these (with the exception of CR and LF, both because the full
name is long and the symbol is more widely used), I'd imagine that what
would be preferred in a variable name would be the written-out form.
Andy
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160723/488c7f05/attachment.html>
More information about the swift-evolution
mailing list