4 ms·
>Now we need to lockstep our team's version upgrade since I just learned some tooling will otherwise bounce it back and forth That sounds like an interesting i
by Zamicol 4y ago
>Now we need to lockstep our team's version upgrade since I just learned some tooling will otherwise bounce it back and forth
That sounds like an interesting issue. Could you perhaps go into more detail?
>means it is now literally a special-case in the fmt code
No. There is no special case, and the logic (literally) runs in the same switch case. https://go-review.googlesource.com/c/go/+/397255/4/src/strconv/quote.go#102 https://go-review.googlesource.com/c/go/+/397255/4/src/strco...
- morelisp 4y agoNah, if you believe - case r < ' ': + case r < ' ' || r == 0x7f: does not introduce a special case, I don't think we'll find any accord through discussion.
- Zamicol 4y agoYes this is minor semantics. Tab, carriage return, new line, etc.. are a special cases: https://go-review.googlesource.com/c/go/+/397255/4/src/strconv/quote.go#96 https://go-review.googlesource.com/c/go/+/397255/4/src/strco... Range selection is not a special case, and it's equivalent to writing it as `case r == 0x00, r == 0x01, r == 0x02 ... r ==0x7f`. The short hand, `r < 0x20`, is far more readable. I would reiterate, the lack of the need for another literal `case` shows that logically this is not a special case. In the sense of the abstract idea of ASCII, 0x7f is unique in its position, but so are all characters. There is no meaning in its positional placement in ASCII. It's totally arbitrary and was thought to be a useful convention. If position denoted other relevant, and unique, meaning to printing, then yes it could be a special case in certain circumstances. But its position has no additional information. And that's the key, no information means no special case.
- morelisp 4y ago> There is no meaning in its positional placement in ASCII. It's totally arbitrary... This is also not true.