Arc Forumnew | comments | leaders | submitlogin
4 points by emmett 6174 days ago | link | parent

Ruby, in 1.8, has arc-style strings: "foo"[0] == 102

In 1.9, it's moving towards Python: "foo"[0] == "f"

This is extremely sensible. I have never wanted the character code of an arbitrary index in a string. I always want a single character substring.



2 points by scav 6174 days ago | link

And in 3.0, Python is adding a bytes type, so b"foo"[0]==102

Obviously both ways are useful. If I had to guess what Arc ends up doing, I'd guess : whatever leads to the programmer having to type less tokens, or whatever facilitates clever macro definitions, leading to same.

-----

5 points by randallsquared 6174 days ago | link

I would suggest that marking a literal vector of bytes is not the most useful role double quotes could play. Python has a lot of history of using that, due to exactly this kind of confusion of strings and vectors of bytes, leading to b"", u"", etc.

-----