Re: On the meaning of string.length

2014-11-21 Thread Dmitry Olshansky via Digitalmars-d-announce
20-Nov-2014 16:50, Adam D. Ruppe пишет: On Wednesday, 19 November 2014 at 21:00:50 UTC, Ary Borenszweig wrote: In Ruby `length` returns the number of unicode characters What is a unicode character? Even in utf-32, one printed character might be made up of two unicode code points. Or

Re: On the meaning of string.length

2014-11-20 Thread Adam D. Ruppe via Digitalmars-d-announce
On Wednesday, 19 November 2014 at 21:00:50 UTC, Ary Borenszweig wrote: In Ruby `length` returns the number of unicode characters What is a unicode character? Even in utf-32, one printed character might be made up of two unicode code points. Or sometimes, two printed characters might come

On the meaning of string.length

2014-11-19 Thread Adam D. Ruppe via Digitalmars-d-announce
I answered a random C# stackoverflow question about why string.length returns the value it does with some rationale defending code units instead of characters - basically, I typed up a defense of D's string-as-array behavior. To my surprise, my answer got an enormous number of votes* so I

Re: On the meaning of string.length

2014-11-19 Thread Upvoter via Digitalmars-d-announce
On Wednesday, 19 November 2014 at 14:33:05 UTC, Adam D. Ruppe wrote: I answered a random C# stackoverflow question about why string.length returns the value it does with some rationale defending code units instead of characters - basically, I typed up a defense of D's string-as-array behavior.

Re: On the meaning of string.length

2014-11-19 Thread Ary Borenszweig via Digitalmars-d-announce
On 11/19/14, 11:33 AM, Adam D. Ruppe wrote: I answered a random C# stackoverflow question about why string.length returns the value it does with some rationale defending code units instead of characters - basically, I typed up a defense of D's string-as-array behavior. In Ruby `length` returns

Re: On the meaning of string.length

2014-11-19 Thread Walter Bright via Digitalmars-d-announce
On 11/19/2014 7:06 AM, Upvoter wrote: On Wednesday, 19 November 2014 at 14:33:05 UTC, Adam D. Ruppe wrote: I think the auto decoding in phobos was and is a mistake. I agree when you say auto decoding is a good choice. Uh-oh!