Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Stringy role. prefix:<^> enforces numeric context. Another specte…
…st file.
  • Loading branch information
pmichaud committed Jul 7, 2011
1 parent 8f7a4ec commit 1701cb2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/Range.pm
Expand Up @@ -141,5 +141,5 @@ sub infix:<^..^>($min, $max) {
Range.new($min, $max, :excludes_min, :excludes_max)
}
sub prefix:<^>($max) {
Range.new(0, $max, :excludes_max)
Range.new(0, $max.Numeric, :excludes_max)
}
2 changes: 1 addition & 1 deletion src/core/Str.pm
@@ -1,4 +1,4 @@
my class Str {
my class Str does Stringy {
method Bool() { self ne '' && self ne '0' }

multi method Str(Str:D:) { self }
Expand Down
2 changes: 1 addition & 1 deletion src/core/Stringy.pm
@@ -1,4 +1,4 @@
# role Stringy { ... }
my role Stringy { }

proto prefix:<~>(|$) { * }
multi prefix:<~>(\$a) { $a.Stringy }
Expand Down
2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -137,7 +137,7 @@ S03-operators/chained-declarators.t
S03-operators/cmp.t
# S03-operators/comparison.t # need Order::Increase
S03-operators/comparison-simple.t
# S03-operators/context-forcers.t # need True
S03-operators/context-forcers.t
# S03-operators/context.t # need regexes
S03-operators/equality.t
# S03-operators/eqv.t
Expand Down

0 comments on commit 1701cb2

Please sign in to comment.