Skip Menu |
Report information
Id: 72820
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] LTA error message when referring to &1 in Rakudo
Date: Mon, 15 Feb 2010 10:21:19 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 207b
<diakopter> rakudo: say &1 <p6eval> rakudo 70667a: OUTPUT«Method 'postcircumfix:<[ ]>' not found for invocant of class '' [...] <frettled> That one was slightly less than awesome. * masak submits rakudobug
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 365b
On Mon Feb 15 01:22:09 2010, masak wrote: Show quoted text
> <diakopter> rakudo: say &1 > <p6eval> rakudo 70667a: OUTPUT«Method 'postcircumfix:<[ ]>' not found > for invocant of class '' [...] > <frettled> That one was slightly less than awesome. > * masak submits rakudobug
Output is now: <Coke> rakudo: say &1; <p6eval> rakudo 2808a5: OUTPUT«Any()␤» -- Will "Coke" Coleda
NOM: bbkr:nom bbkr$ ./perl6 -e 'say &1' Nil
Download (untitled) / with headers
text/plain 3.5k
[15:03] <bbkr> masak: what is the expected behavior in https://rt.perl.org/rt3/Ticket/Display.html?id=72820 ? [15:04] <moritz> std: &1 [15:04] <p6eval> std bb4f150: OUTPUT«ok 00:01 121m␤» [15:05] <moritz> std: &foo [15:06] <p6eval> std bb4f150: OUTPUT«ok 00:01 121m␤» [15:06] <benabik> &1? What's that mean? Does that return something like `-> { return 1 }`? [15:06] <moritz> why doesn't that produce the same error as foo() ? [15:06] <moritz> benabik: &foo returns a reference to the routine named 'foo' [15:06] <benabik> moritz: Right. But I'm confused about it working on a number. [15:06] <moritz> benabik: so &1 would be a reference to a routine named '1' [15:07] <moritz> benabik: and I'm confused about it not being a compile time lookup [15:07] <benabik> std: sub 1 { … } [15:07] <p6eval> std bb4f150: OUTPUT«===SORRY!===␤Malformed block at /tmp/SBxx_WovI3 line 1:␤------> sub ⏏1 { … }␤ expecting any of:␤ name␤ routine_def␤ trait␤Parse failed␤FAILED 00:01 117m␤» [15:07] <bbkr> you cannot name routine '1' [15:07] <benabik> std: sub 1 { ... } [15:07] <p6eval> std bb4f150: OUTPUT«===SORRY!===␤Malformed block at /tmp/_zoQ8AtasP line 1:␤------> sub ⏏1 { ... }␤ expecting any of:␤ name␤ routine_def␤ trait␤Parse failed␤FAILED 00:01 117m␤» [15:07] <moritz> nom: Q:PIR { .lex '&1' }; say &1 [15:07] <p6eval> nom d97997: OUTPUT«Use of uninitialized value in string context␤Use of uninitialized value in string context␤===SORRY!===␤error:imcc:syntax error, unexpected '\n', expecting COMMA␤ in file '(file unknown)' line 841␤␤» [15:07] <benabik> std: sub '1' { ... } [15:07] <p6eval> std bb4f150: OUTPUT«===SORRY!===␤Malformed block at /tmp/U_Hs6qOCtu line 1:␤------> sub ⏏'1' { ... }␤ expecting any of:␤ name␤ routine_def␤ trait␤Parse failed␤FAILED 00:01 117m␤» [15:08] <jnthn> std: @1 [15:08] <p6eval> std bb4f150: OUTPUT«ok 00:01 118m␤» [15:08] <benabik> moritz: The syntax for .lex is .lex <variable name> <register> [15:08] <daxim> has anyone already written working shapely/eyedrops style P6 programs? http://code.google.com/codejam/japan/tshirt.html [15:08] <moritz> nom: Q:PIR { .lex '&1' $P0 }; say &1 [15:08] <p6eval> nom d97997: OUTPUT«Use of uninitialized value in string context␤Use of uninitialized value in string context␤===SORRY!===␤error:imcc:syntax error, unexpected PREG, expecting COMMA ('$P0')␤ in file '(file unknown)' line 137␤␤» [15:08] <jnthn> moritz: I think it may be parsed as an accidental side-effect of parsing $1, etc [15:08] <moritz> jnthn: sounds plausible-ish [15:09] <-- colomon has left this server (Quit: colomon). [15:09] <jnthn> nom: "foo" ~~ /(f)/; say $0 [15:09] <p6eval> nom d97997: OUTPUT«f␤» [15:09] <jnthn> nom: "foo" ~~ /(f)/; say @0 [15:09] <p6eval> nom d97997: OUTPUT«f␤» [15:09] <jnthn> nom: "foo" ~~ /(f)/; say &0 [15:09] <p6eval> nom d97997: OUTPUT«f␤» [15:09] <jnthn> heh :) [15:09] * moritz did that, probably [15:09] <moritz> jnthn++ [15:09] <bbkr> so this ticket should be rejected as not a bug? [15:09] <jnthn> b: "foo" ~~ /(f)/; say &0 [15:09] <p6eval> b 1b7dd1: OUTPUT«f␤» [15:09] <jnthn> moritz: I think we may have always had it like that, just never realized ;) [15:09] <moritz> ok, I just reused it :-) [15:10] <jnthn> .oO( let's call it a feature ;-) ) [15:11] <jnthn> Guess a [ <?{ $<sigil> eq '$'}> <.panic: '...'> ] or so in the right place would catch it though.
Download (untitled) / with headers
text/plain 221b
There was a bit of discussion today on this: http://irclog.perlgeek.de/perl6/2016-07-06#i_12795274 Since the originally reported LTA error is gone, I'm going to close this. The 5-year old mold is starting to give off ;)
Download (untitled) / with headers
text/plain 507b
On Wed, 06 Jul 2016 10:05:13 -0700, cpan@zoffix.com wrote: Show quoted text
> There was a bit of discussion today on this: > http://irclog.perlgeek.de/perl6/2016-07-06#i_12795274 > > Since the originally reported LTA error is gone, I'm going to close > this. The 5-year old mold is starting to give off ;)
If you look at the log linked above it looks like a PR was going to be submitted for this, but according to https://irclog.perlgeek.de/perl6-dev/2017-03-05#i_14208424 it didn't work, so this is still an open ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org