|Perl Monk, Perl Meditation|
Re^4: Repurposing reverseby ikegami (Pope)
|on Jan 31, 2011 at 08:56 UTC||Need Help??|
No. Quite the opposite, I'm saying there is no distinction. reverse doesn't know or care what the string is, and has no way of knowing. It will reverse the characters (elements?) of the string.
You opened the debate! Again, a common CS definition is used here: A string is a sequence of elements named characters. Would you care to suggest an alternative?
Unicode has four definitions for "character", and none correspond exactly to that of "grapheme".
But it's irrelevant. Again, reverse function isn't to manipulate text.
Yes, but irrelevant. reverse's function isn't to manipulate words. There are five characters in the string chr(0x43).chr(0x61).chr(0x66).chr(0x65).chr(0x301).
Again, quite the opposite. It has nothing to do with Perl internals. It's not even specific to Perl. A string is a data type. Text is one of many things that can be stored in a string.
You're suggesting that Perl should reverse strings as if they're text. For example, you say
But that's wholly inappropriate for water level measurements or for anything else the string might be.
There is need for a function that reverses strings (chr(101).chr(769) ⇒ chr(769).chr(101)). There is also a need for a function that reverses text (chr(101).chr(769) ⇒ chr(101).chr(769)). reverse does the former.