Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Stringy role. prefix:<^> enforces numeric context. Another specte…

…st file.
  • Loading branch information...
commit 1701cb2e22d3f732eb1d07fab00cec9169cf152b 1 parent 8f7a4ec
@pmichaud pmichaud authored
View
2  src/core/Range.pm
@@ -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)
}
View
2  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 }
View
2  src/core/Stringy.pm
@@ -1,4 +1,4 @@
-# role Stringy { ... }
+my role Stringy { }
proto prefix:<~>(|$) { * }
multi prefix:<~>(\$a) { $a.Stringy }
View
2  t/spectest.data
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.