develooper Front page | perl.perl6.language | Postings from July 2010

Re: Suggested magic for "a" .. "b"

Thread Previous | Thread Next
From:
Jon Lang
Date:
July 28, 2010 23:05
Subject:
Re: Suggested magic for "a" .. "b"
Message ID:
AANLkTi=084eo6-k1g+iAAx1_dMAThN1SHv6JevTJ6qbr@mail.gmail.com
On Wed, Jul 28, 2010 at 10:35 PM, Brandon S Allbery KF8NH
<allbery@ece.cmu.edu> wrote:
>  On 7/28/10 8:07 PM, Michael Zedeler wrote:
>> On 2010-07-29 01:39, Jon Lang wrote:
>>> Aaron Sherman wrote:
>>>>> In smart-match context, "a".."b" includes "aardvark".
>>>> No one has yet explained to me why that makes sense. The continued
>>>> use of
>>>> ASCII examples, of course, doesn't help. Does "a" .. "b" include
>>>> "æther"?
>>>> This is where Germans and Swedes, for example, don't agree, but
>>>> they're all
>>>> using the same Latin code blocks.
>>> This is definitely something for the Unicode crowd to look into.  But
>>> whatever solution you come up with, please make it compatible with the
>>> notion that "aardvark".."apple" can be used to match any word in the
>>> dictionary that comes between those two words.
>> The key issue here is whethere there is a well defined and meaningful
>> ordering of the characters in question. We keep discussing the nice
>> examples, but how about "apple" .. "ส้ม"?
>
> I thought that was already disallowed by spec.

As a range, it ought to work; it's only when you try to generate a
list from it that you run into trouble, as the spec currently assumes
that "z".succ eqv "aa".

Anyway: whatever default algorithm we go with for resolving "cmp", I
strongly recommend that we define the default .succ so that "$x lt
$x.succ" is always true.

-- 
Jonathan "Dataweaver" Lang

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About