On 12/23/05, TSa <[EMAIL PROTECTED]> wrote:
> HaloO Everybody,
>
> here's a an idea from me about makeing range object a bit like
> junctions. That is a range object has a $.min and $.max and the
> following comparison behaviour:
>
> str num
>
> lt < strictly inside ---------+
> gt > strictly outside ------+ |
> eq == exactly on boundary --+ | |
> | | | negation
> ne != not on boundary --+ | |
> le <= inside or on boundary --+ |
> ge >= outside or on boundary ---+
This bugs me almost as much as junctions bug me, because you're
messing with the laws of comparisons.
my $a = 1..10;
2 < $a; # true
$a < -5; # true
2 < -5; # false
In fact, it might even bug me more. I'm a proponent of the idea that
one name (in a particular scope) is one concept. We don't overload +
to mean "concatenation", we don't overload << to mean "output", and we
don't overload > to mean "outside".
Supposing you fixed those operators, I really think that this is a job
for a module. All the syntax and semantics you propose can be easily
implemented by a module, except for the basic definition of "..".
Maybe you could make it your first Perl 6 module?
Luke