Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: Repurposing reverse

by ikegami (Pope)
on Jan 31, 2011 at 09:01 UTC ( #885216=note: print w/replies, xml ) Need Help??

in reply to Re^3: How to reverse a (Unicode) string
in thread How to reverse a (Unicode) string

As for the question you added,

Explain why you think this……should produce different output than this…

I agree that there should be a function that does that, but it's not reverse.

Explain why you think

my $water_samples = join '', map chr, 113, 101, 769; my $last_sample = substr($water_samples, -1, 1); print(ord($last_sample), "\n");

should produce different output than

my $water_samples = join '', map chr, 113, 101, 769; $water_samples = reverse($water_samples); my $last_sample = substr($water_samples, 0, 1); print(ord($last_sample), "\n");

Update: Corrected my numbers.

Replies are listed 'Best First'.
Re^5: How to reverse a (Unicode) string
by Jim (Curate) on Jan 31, 2011 at 09:39 UTC

    Your rhetorical volley is irrelevant and off-topic as it has nothing whatever to do with Unicode.

    My simple, clear, plain point is that the Perl reverse function is broken because when it reverses what is simply, clearly, plainly a Unicode string with grapheme clusters or jamo in it, it gets it wrong.

    Perl's built-in string reverse function is not fully Unicode-conformant. That's all.

      I don't understand your point. Of course it doesn't handle Unicode. We've always been in agreement about that. The conversation started when you claimed it should and that it shouldn't handle code you just called "rhetorical" and "irrelevant".

      Update: Cleaned up the wording.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885216]
[1nickt]: We have a new tick in cenral New Jersey this year. The Lone Star tick -- no Lyme, but will give you an allergy to red meat!
[Your Mother]: "Tick Twister."
[1nickt]: My sister lives in the Sydney suburbs (carved out of the bush) and they have the Paralysis tick -- leavs you quadriplegic!
[perldigious]: Hmm, thanks Lotus1... perldigious scribbles note to buy lots of opossums as "pets" in the future to hang around outside his property. :-P
[1nickt]: You must twist and pull! If you burn, use tea tree oil etc, the tick barfs (inside your blood vessel) and you get all the loevely bacteria in his gut transferred to yours.
[1nickt]: tweesers work just fine
[hippo]: Hope everyone else is enjoying their lunch too.
[1nickt]: However, note that it takes between 2 and 4 hours for a tick to be able to start transmitting bacteria. So even if it has burrowed in and started eating, if you get it soon you should be OK.
[perldigious]: 1nickt: No more red meat! It would be more humane to just kill you, wouldn't it! :-)
[1nickt]: Just don't make it barf.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-05-24 13:08 GMT
Find Nodes?
    Voting Booth?