Ruby 1.9
Top Comments
All Comments (51)
-
Thanks Matz for creating Ruby!
-
You're right, I hadn't thought of all those diacritical marks (Wikipedia has a nice page called »Combining_character« about those) which sometimes even could not be resscued with Unicode_normalization (another Wiki page) if reversed. Good point. I wish I could watch the talk.
)-;
-
No, not reversing bytewise, that's not just useless, it's plain wrong. I was refering to modifying characters that exist in the unicode standard for some code pages. Think of it as diacritic+letter which is (in those cases) supposed to render the diacritic on top of the letter (or below or whatever, together anyway). In that case, not only you're supposed to separate multibyte characters one from another but also know about every such case, and those are arbitrary of course.
-
@heloizyjhenifer: heh, I see. Reversing an utf8 string byte for byte instead of char by char, eh?
But really, my proposed solution works transparently and is fast enough because of the Unicode support in the oniguruma regular expression engine. Just split the string with scan() into an array, reverse the array, then join the array to a new string which will be reversed: in my example, »ÈdoçinU«.
(-:
-
What I meant is that reversing a fully generic unicode string is in itself a bad idea because it can contain order dependent characters, now looking for a fast (as in optimized) way to doing this (which is what was asked by someone to the speaker) is stupid because there is provably no fast way. It's even hard to explain how pointless/meaningless/stupid at all levels it is :). The speaker was a bit stomped, understandably.
-
In any programming language worth learning, easy tasks should be easy and hard tasks should be possible.
Reversing a string of codepoints ought to be among the easy tasks, no matter how useless you might think it is.
I cannot view this talk in Germany, because Google doesn't allow it for some reason. That said, I suggest 'UniçodÈ'.scan(/./).reverse.jo
in for reversing a Unicode string. -
Why would one want to reverse a fully unicode string anyway. What about the modifying characters in the standard, reversing them would make no sense, keeping their order would make any structure behave sub O(1) for doing it.
-
This guy is soooooooooooo smart, why be a Moron? i mean Mormon? Is the video description correct? The man who invents ruby believes J. Smith ha ha ha just doesnt make sense
-
Stil not enterprise level framework,,look at smalltalk,,I will wait till 2.0
- Loading comment...
I think Matz is a Buddha. People within a 5 foot radius of him start smiling and feel vaguely smarter and happier.
sgharms 3 years ago 40
Cool, Ruby 2 and Perl 6 will both be released on the same day - Christmas.
natlang1 4 years ago 20