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

Cannot combine infix:<.=> and string methodrefs in Rakudo #1290

Closed
p6rt opened this issue Sep 17, 2009 · 10 comments
Closed

Cannot combine infix:<.=> and string methodrefs in Rakudo #1290

p6rt opened this issue Sep 17, 2009 · 10 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 17, 2009

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

Searchable as RT69204$

@p6rt
Copy link
Author

p6rt commented Sep 17, 2009

From @masak

<masak> rakudo​: say "oh hai" .= uc
<p6eval> rakudo 2953ac​: OUTPUT«OH HAI␤»
<masak> rakudo​: say "oh hai"."uc"
<p6eval> rakudo 2953ac​: OUTPUT«OH HAI␤»
<masak> rakudo​: my $a = "oh hai"; say $a.="uc"
<p6eval> rakudo 2953ac​: OUTPUT«OH HAI␤»
<masak> rakudo​: my $a = "oh hai"; say $a .= "uc"
<sjohnson> heh
<p6eval> rakudo 2953ac​: OUTPUT«.= must have a call on the right hand side [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 12, 2010

From @bbkr

[18​:14] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> rakudo bb6df2​: OUTPUT«===SORRY!===␤Quoted method name
requires parenthesized arguments at line 20, near ""␤»

[18​:14] <bbkr> std​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> std 31643​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Unsupported use of . to
concatenate strings or to call a quoted method; in Perl 6 please use ~
to concatenate, or if you meant to call a quoted method, please supply
the required parentheses at /tmp/HDXgt_YnN3 line 1​:␤------> �[32mmy $a =
"oh hai";

String methodrefs are not valid without parentheses.

But example that was causing trouble works now​:

[18​:16] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"()
[18​:16] <p6eval> rakudo bb6df2​: OUTPUT«OH HAI␤»

Taken for tests.

@p6rt
Copy link
Author

p6rt commented Jul 12, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 12, 2010

From @bbkr

well, but STD disagrees

[18​:22] <bbkr> std​: my $a = "oh hai"; say $a .= "uc"()
[18​:22] <p6eval> std 31643​: OUTPUT«Potential difficulties​:␤ Useless use
of quotes at /tmp/OiJYK6kYDj line 1​:␤------> �[32mmy $a = "oh hai"; say
$a .= "uc"�[33m⏏�[31m()�[0m␤ Unsupported use of .= as append operator;
in Perl 6 please use ~= at /tmp/OiJYK6kYDj line 1​:␤------> �[32mmy $a =
"oh hai"; say $a
[18​:22] <p6eval> ...=�[33m⏏�[3…

@p6rt
Copy link
Author

p6rt commented Aug 11, 2010

From @bbkr

rechecked on * release, same result

Note​:
STD warns that .= is an P5 concat. In this case such warning should be
also displayed by Rakudo.

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

On Mon Jul 12 09​:18​:47 2010, bbkr wrote​:

[18​:14] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> rakudo bb6df2​: OUTPUT«===SORRY!===␤Quoted method
name
requires parenthesized arguments at line 20, near ""␤»

[18​:14] <bbkr> std​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> std 31643​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Unsupported use of . to
concatenate strings or to call a quoted method; in Perl 6 please use ~
to concatenate, or if you meant to call a quoted method, please supply
the required parentheses at /tmp/HDXgt_YnN3 line 1​:␤------> �[32mmy $a
=
"oh hai";

String methodrefs are not valid without parentheses.

But example that was causing trouble works now​:

[18​:16] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"()
[18​:16] <p6eval> rakudo bb6df2​: OUTPUT«OH HAI␤»

Taken for tests.

new failure mode​:

16​:11 <diakopter> rakudo​: my $a = "oh hai"; say $a .= "uc"()
16​:11 <p6eval> rakudo 3b1596​: OUTPUT«No such method 'Capture[0xa7f4a80]'
for invocant of
  type 'Str'␤ in method dispatch​:<.=> at
src/gen/CORE.setting​:824␤ in block
  <anon> at /tmp/dVBS2sG7ir​:1␤␤»

@p6rt
Copy link
Author

p6rt commented Feb 9, 2015

From @Mouq

Behavior is now​:

$ perl6 -e'my $a = "oh hai"; say $a .= "uc"()'
No such method '' for invocant of type 'Str'
  in method dispatch​:<.=> at src/gen/m-CORE.setting​:1330
  in block <unit> at -e​:1

$ perl6 -e'my $a = "oh hai"; say $a.="uc"()'
OH HAI
$ perl6 -v
This is perl6 version 2015.01-114-g9db8b8d built on MoarVM version 2015.01-28-ga910556

On Tue May 29 14​:13​:51 2012, diakopter wrote​:

On Mon Jul 12 09​:18​:47 2010, bbkr wrote​:

[18​:14] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> rakudo bb6df2​: OUTPUT«===SORRY!===␤Quoted method
name
requires parenthesized arguments at line 20, near ""␤»

[18​:14] <bbkr> std​: my $a = "oh hai"; say $a .= "uc"
[18​:14] <p6eval> std 31643​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Unsupported use of . to
concatenate strings or to call a quoted method; in Perl 6 please use ~
to concatenate, or if you meant to call a quoted method, please supply
the required parentheses at /tmp/HDXgt_YnN3 line 1​:␤------> �[32mmy $a
=
"oh hai";

String methodrefs are not valid without parentheses.

But example that was causing trouble works now​:

[18​:16] <bbkr> rakudo​: my $a = "oh hai"; say $a .= "uc"()
[18​:16] <p6eval> rakudo bb6df2​: OUTPUT«OH HAI␤»

Taken for tests.

new failure mode​:

16​:11 <diakopter> rakudo​: my $a = "oh hai"; say $a .= "uc"()
16​:11 <p6eval> rakudo 3b1596​: OUTPUT«No such method 'Capture[0xa7f4a80]'
for invocant of
type 'Str'␤ in method dispatch​:<.=> at
src/gen/CORE.setting​:824␤ in block
<anon> at /tmp/dVBS2sG7ir​:1␤␤»

@p6rt
Copy link
Author

p6rt commented Oct 3, 2015

From @FROGGS

I come to the conclusion that making $foo.="bar"() work is more useful than complaining about a potential P5ism.

So, patch and tests are here​:
rakudo/rakudo@98d9b87aaa
Raku/roast@5f82bde7e0

Closing ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 3, 2015

From @FROGGS

I come to the conclusion that making $foo.="bar"() work is more useful than complaining about a potential P5ism.

So, patch and tests are here​:
rakudo/rakudo@98d9b87aaa
Raku/roast@5f82bde7e0

Closing ticket.

@p6rt p6rt closed this as completed Oct 3, 2015
@p6rt
Copy link
Author

p6rt commented Oct 3, 2015

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant