Aaron Sherman wrote:
> Oh bother, I wrote this up last night, but forgot to send it. Here y'all
> go:
>
> I've been testing ".." recently, and it seems, in Rakudo, to behave like
> Perl 5. That is, the magic auto-increment for "a" .. "z" works very
> wonkily,
> given any range that isn't within some very strict definitions (identical
> Unicode general category, increasing, etc.) So the following:
>
> "A" .. "z"
>
> produces very odd results.

Bear in mind that ".." is no longer supposed to be used to generate
lists; for that, you should use "...".  That said, that doesn't
address the issues you're raising; it merely spreads them out over two
operators (".." when doing pattern matching, and "..." when doing list
generation).

Your restrictions and algorithms are a good start, IMHO; and at some
point when I have the time, energy, and know-how, I'll read through
them in detail and comment on them.  In the meantime, though, let me
point out a fairly obvious point: sometimes, I want my pattern
matching and list generation to be case-sensitive; other times, I
don't.  More generally, whatever algorithm you decide on should be
subject to tweaking by the user to more accurately reflect his
desires.  So perhaps ".." and "..." should have an adverb that lets
you switch case sensitivity on (if the default is "off") or off (if
the default is "on").  And if you do this, there should be function
forms of ".." and "..." for those of us who have trouble working with
the rules for applying adverbs to operators.  Likewise with other
situations where there might be more than one way to approach things.

-- 
Jonathan "Dataweaver" Lang

Reply via email to