3 ms·
(1) It's obviously less ambiguous, because you can't do it accidentially; "\(" is an invalid escape, whereas "${1}" or "$a" is a valid string (i.e. you could wr
by tomp 10y ago
(1) It's obviously less ambiguous, because you can't do it accidentially; "\(" is an invalid escape, whereas "${1}" or "$a" is a valid string (i.e. you could write it without meaning to interpolate the variables).
(2) It's only consistent if you always know what your pointers are pointing at, and whether your pointers are the last reference to it... but then you can just use delete, right?
- berdario 10y ago(1) you're confusing C string and other languages strings (even Swift strings are not the same thing as NSString or C strings). Anyhow, even in C \( is perfectly accepted by compilers gcc -Wall -x c - <<EOF #include <stdio.h> int main(){ printf("\(hi"); } EOF So it's perfectly reasonable to write it and not mean interpolation (maybe they meant "\\(", but that's another matter) (2) A sequence can be sorted without you knowing which elements are inside it, A computation can be known to terminate without you knowing (yet) which value it will yield. Similarly, you don't need to have internal knowledge of your code to know that you'll be able to rely on RC consistency in the future (otoh I guess that something consistent is not necessarily the same as something predictable)
- hk__2 10y ago> Anyhow, even in C \( is perfectly accepted by compilers Even if it’s accepted it’s not valid, at least in the C99 standard.