Aaron Sherman wrote:
> So, what's the intention of the range operator, then? Is it just there to
> offer backward compatibility with Perl 5? Is it a vestige that should be
> removed so that we can Huffman ... down to ..?
> I'm not trying to be difficult, here, I just never knew that ... could
> operate on a single item as LHS, and if it can, then .. seems to be obsolete
> and holding some prime operator real estate.
On the contrary: it is not a vestige, it is not obsolete, and it's
making good use of the prime operator real estate that it's holding.
It's just not doing what it did in Perl 5.
I strongly recommend that you reread S03 to find out exactly what each
of these operators does these days.
>> The questions definitely look different that way: for example,
>> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz is easily and
>> clearly expressed as
>> 'A' ... 'Z', 'a' ... 'z' # don't think this works in Rakudo yet :(
> I still contend that this is so frequently desirable that it should have a
> simpler form, but it's still going to have problems.
> One example: for expressing "Katakana letters" (I use "letters" in the
> Unicode sense, here) it's still dicey. There are things interspersed in the
> Unicode sequence for Katakana that aren't the same thing at all. Unicode
> calls them lowercase, but that's not quite right. They're smaller versions
> of Katakana characters which are used more as punctuation or accents than as
> syllabic glyphs the way the rest of Katakana is.
> I guess you could write:
> ア, イ, ウ, エ, オ, カ ... ヂ,ツ ...モ,ヤ, ユ, ヨ ... ロ, ワ ... ヴ (add quotes to taste)
> But that seems quite a bit more painful than:
> ア .. ヴ (or ... if you prefer)
> Similar problems exist for many scripts (including some of Latin, we're just
> used to the parts that are odd), though I think it's possible that Katakana
> may be the worst because of the mis-use of Ll to indicate a letter when the
> truth of the matter is far more complicated.
Some of this might be addressed by filtering the list as you go -
though I don't remember the method for doing so. Something like
.grep, I think, with a regex in it that only accepts letters:
(ア ... ヴ).«grep(/<:alpha:>/)
...or something to that effect.
Still, it's possible that we might need something that's more flexible
Jonathan "Dataweaver" Lang