New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$str.Num should be the same as +$str #1108
Comments
From @moritz13:52 < zulon> rakudo: say "3".Num |
From allbery@ece.cmu.eduI thought unary + was scalar/item? context in perl6, not numify. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @masakOn Tue Jun 30 01:56:39 2009, allbery@ece.cmu.edu wrote:
When in doubt, check the spec. :) S03 (]): So prefix:<~> stringifies, prefix:<+> numifies, and prefix<?> boolifies. |
From @markjreedOn Tue, Jun 30, 2009 at 4:55 AM, Brandon S. Allbery
+ is numeric context - which is one of several subtypes of item I'm guessing you saw + used to get the length of an array, and that's -- |
From tann@gmx.comrt-67050.patchdiff --git a/src/setting/Str.pm b/src/setting/Str.pm
index 636e264..4878a5e 100644
--- a/src/setting/Str.pm
+++ b/src/setting/Str.pm
@@ -2,4 +2,8 @@ class Str is also {
method encode($encoding = 'UTF-8', $nf = '') {
return Buf.new();
}
+
+ method Num() {
+ return +self;
+ }
}
|
From @bbkr[18:59] <bbkr> rakudo: say "3".Num; # |
@bbkr - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#67050 (status was 'resolved')
Searchable as RT67050$
The text was updated successfully, but these errors were encountered: