Skip to content
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

method form of postfix:<i> #630

Closed
p6rt opened this issue Jan 15, 2009 · 12 comments
Closed

method form of postfix:<i> #630

p6rt opened this issue Jan 15, 2009 · 12 comments
Labels
LHF Low-hanging fruit, easy to resolve Todo

Comments

@p6rt
Copy link

p6rt commented Jan 15, 2009

Migrated from rt.perl.org#62382 (status was 'resolved')

Searchable as RT62382$

@p6rt
Copy link
Author

p6rt commented Jan 15, 2009

From @masak

<TimToady> rakudo​: my $t = 5; say $t.i
<p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
class 'Int [...]
<masak> TimToady​: should that work?
<TimToady> think so
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jan 15, 2009

From @masak

On Wed Jan 14 22​:00​:33 2009, masak wrote​:

<TimToady> rakudo​: my $t = 5; say $t.i
<p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
class 'Int [...]
<masak> TimToady​: should that work?
<TimToady> think so
* masak submits rakudobug

Also this​:

<TimToady> hmm
<TimToady> rakudo​: my $t = 5; say $t\i
<p6eval> rakudo 35576​: OUTPUT«Statement not terminated properly at line
1, near "\\i" [...]

@p6rt
Copy link
Author

p6rt commented Jan 15, 2009

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 15, 2009

From @pmichaud

On Wed, Jan 14, 2009 at 10​:02​:21PM -0800, Carl Mäsak via RT wrote​:

On Wed Jan 14 22​:00​:33 2009, masak wrote​:

<TimToady> rakudo​: my $t = 5; say $t.i
<p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
class 'Int [...]
<masak> TimToady​: should that work?
<TimToady> think so
* masak submits rakudobug

Also this​:

<TimToady> hmm
<TimToady> rakudo​: my $t = 5; say $t\i
<p6eval> rakudo 35576​: OUTPUT«Statement not terminated properly at line
1, near "\\i" [...]

This latter note is a duplicate of RT #​60148, and the comment there
still holds that STD.pm doesn't parse it either​:

  15​:52 <pmichaud> std​: my $t = 5; $t\i
  15​:52 <p6eval> std 24912​: OUTPUT«############# PARSE FAILED #############␤...

Pm

@p6rt
Copy link
Author

p6rt commented Jan 15, 2009

From @pmichaud

On Wed, Jan 14, 2009 at 10​:00​:33PM -0800, Carl Mäsak wrote​:

<TimToady> rakudo​: my $t = 5; say $t.i
<p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
class 'Int [...]
<masak> TimToady​: should that work?
<TimToady> think so
* masak submits rakudobug

Rakudo doesn't yet recognize the dotty form of postfix operators --
that will likely come when we have protoregexes in PGE.

Just to verify​: $t.i should always parse as postfix​:<i> and
never as a method call here? (That's what STD.pm currently
does, if I'm reading it correctly.)

Pm

@p6rt
Copy link
Author

p6rt commented Jan 16, 2009

From @TimToady

On Thu, Jan 15, 2009 at 10​:08​:22AM -0600, Patrick R. Michaud wrote​:
: On Wed, Jan 14, 2009 at 10​:00​:33PM -0800, Carl Mäsak wrote​:
: > <TimToady> rakudo​: my $t = 5; say $t.i
: > <p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
: > class 'Int [...]
: > <masak> TimToady​: should that work?
: > <TimToady> think so
: > * masak submits rakudobug
:
: Rakudo doesn't yet recognize the dotty form of postfix operators --
: that will likely come when we have protoregexes in PGE.
:
: Just to verify​: $t.i should always parse as postfix​:<i> and
: never as a method call here? (That's what STD.pm currently
: does, if I'm reading it correctly.)

$t.i is now always a method, and you must use ($t)i or $t\i for postfix.

Larry

@p6rt
Copy link
Author

p6rt commented Jan 16, 2009

From @TimToady

On Thu, Jan 15, 2009 at 09​:58​:12AM -0600, Patrick R. Michaud wrote​:
: On Wed, Jan 14, 2009 at 10​:02​:21PM -0800, Carl Mäsak via RT wrote​:
: > On Wed Jan 14 22​:00​:33 2009, masak wrote​:
: > > <TimToady> rakudo​: my $t = 5; say $t.i
: > > <p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
: > > class 'Int [...]
: > > <masak> TimToady​: should that work?
: > > <TimToady> think so
: > > * masak submits rakudobug
: >
: > Also this​:
: >
: > <TimToady> hmm
: > <TimToady> rakudo​: my $t = 5; say $t\i
: > <p6eval> rakudo 35576​: OUTPUT«Statement not terminated properly at line
: > 1, near "\\i" [...]
:
: This latter note is a duplicate of RT #​60148, and the comment there
: still holds that STD.pm doesn't parse it either​:
:
: 15​:52 <pmichaud> std​: my $t = 5; $t\i
: 15​:52 <p6eval> std 24912​: OUTPUT«############# PARSE FAILED #############␤...

Now parses as specced.

Larry

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

From @bacek

On Wed Jan 14 22​:00​:33 2009, masak wrote​:

<TimToady> rakudo​: my $t = 5; say $t.i
<p6eval> rakudo 35576​: OUTPUT«Method 'i' not found for invocant of
class 'Int [...]
<masak> TimToady​: should that work?
<TimToady> think so
* masak submits rakudobug

Implementation of postfix​:i there -
http://github.com/bacek/rakudo/commit/5bcbbd788276d3b421861e7b0c2a723136c36ddb

--
Bacek.

@p6rt
Copy link
Author

p6rt commented Sep 26, 2009

From jswitzer@gmail.com

The attached patch is more up-to-date in that it adds this method to the
setting.

-Jason "s1n" Switzer

@p6rt
Copy link
Author

p6rt commented Sep 26, 2009

From jswitzer@gmail.com

anyi.patch
diff --git a/src/setting/Any-num.pm b/src/setting/Any-num.pm
index 5391038..2953806 100644
--- a/src/setting/Any-num.pm
+++ b/src/setting/Any-num.pm
@@ -27,6 +27,10 @@ class Any is also {
         }
     }
 
+    multi method i() is export {
+        self * 1i;
+    }
+
     our Num method rand() {
         Q:PIR {
             $N0 = self

@p6rt
Copy link
Author

p6rt commented Sep 5, 2010

From @ShimmerFairy

()i and \i are working fine, and tests have been added to
S32-num/complex.t . I'm declaring this resolved.

@p6rt
Copy link
Author

p6rt commented Sep 5, 2010

@ShimmerFairy - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 5, 2010
@p6rt p6rt added LHF Low-hanging fruit, easy to resolve Todo labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LHF Low-hanging fruit, easy to resolve Todo
Projects
None yet
Development

No branches or pull requests

1 participant