From cf189ea940dbf242263c111186000776e35c8a47 Mon Sep 17 00:00:00 2001 From: Solomon Foster Date: Tue, 9 Feb 2010 19:58:02 -0500 Subject: [PATCH] Start at a infix:<...>(@lhs, Whatever) implementation, which utterly fails to be called at the moment. --- src/core/operators.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/operators.pm b/src/core/operators.pm index 3035f3ddd19..9602f43b707 100644 --- a/src/core/operators.pm +++ b/src/core/operators.pm @@ -143,10 +143,12 @@ our sub WHAT(\$x) { $x.WHAT } +class Whatever { ... } + # the magic one that handles stuff like # 'a' ... 'z' and 'z' ... 'a' our multi sub infix:<...>($lhs, $rhs) { - if $rhs ~~ ::Whatever { + if $rhs ~~ Whatever { my $i = $lhs; return gather { loop { @@ -198,3 +200,11 @@ our multi sub infix:<...>($lhs, Code $rhs) { } } } + +our multi sub infix:<...>(@lhs, Whatever) { + given @lhs.elems { + when 2 { + @lhs[0] ... { $_ + (@lhs[1] - @lhs[0]) }; + } + } +}