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

LTA error when using s[] = "rea" #2848

Open
p6rt opened this issue Aug 4, 2012 · 13 comments
Open

LTA error when using s[] = "rea" #2848

p6rt opened this issue Aug 4, 2012 · 13 comments

Comments

@p6rt
Copy link

p6rt commented Aug 4, 2012

Migrated from rt.perl.org#114388 (status was 'open')

Searchable as RT114388$

@p6rt
Copy link
Author

p6rt commented Aug 4, 2012

From @zhuomingliang

JimmyZ_ r​: s[ea] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«No such method 'subst' for invocant of type 'Any'␤ in block at /tmp/htGuR5us8T​:1␤␤»
masak sorear​: \o
JimmyZ_ r​: $_ = ""; s[ ] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«rea␤»
JimmyZ_ r​: $_ = ""; s[] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter ] (must be quoted to match literally) at line 2, near " = \"rea\"; "␤»
JimmyZ_ std​: $_ = ""; s[ ] = "rea"; .say
p6eval std f43a358​: OUTPUT«===SORRY!===␤Null pattern not allowed at /tmp/VK1jegzuR7 line 1​:␤------> $_ = ""; s[ ⏏] = "rea"; .say␤ expecting quantifier␤Parse failed␤FAILED 00​:00 43m␤»


Jimmy Zhuo

@p6rt
Copy link
Author

p6rt commented Aug 4, 2012

From @moritz

On 08/04/2012 10​:38 AM, Jimmy Zhuo (via RT) wrote​:

# New Ticket Created by "Jimmy Zhuo"
# Please include the string​: [perl #​114388]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=114388 >

JimmyZ_ r​: s[ea] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«No such method 'subst' for invocant of type 'Any'␤ in block at /tmp/htGuR5us8T​:1␤␤»

What would you expect?
The spec says that s[] desugars to a call to 'subst', so I consider it
correct. We could improve the error, but what should it say?

JimmyZ_ r​: $_ = ""; s[ ] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«rea␤»
JimmyZ_ r​: $_ = ""; s[] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter ] (must be quoted to match literally) at line 2, near " = \"rea\"; "␤»
JimmyZ_ std​: $_ = ""; s[ ] = "rea"; .say
p6eval std f43a358​: OUTPUT«===SORRY!===␤Null pattern not allowed at /tmp/VK1jegzuR7 line 1​:␤------> $_ = ""; s[ ⏏] = "rea"; .say␤ expecting quantifier␤Parse failed␤FAILED 00​:00 43m␤»

I'm pretty sure we have a separate ticket for that.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Aug 4, 2012

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

@p6rt
Copy link
Author

p6rt commented Aug 5, 2012

From @zhuomingliang

在 2012-08-04 02​:12​:41 星期六 时,moritz 写到:

On 08/04/2012 10​:38 AM, Jimmy Zhuo (via RT) wrote​:

# New Ticket Created by "Jimmy Zhuo"
# Please include the string​: [perl #​114388]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=114388 >

JimmyZ_ r​: s[ea] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«No such method 'subst' for invocant of
type 'Any'␤ in block at /tmp/htGuR5us8T​:1␤␤»

What would you expect?
The spec says that s[] desugars to a call to 'subst', so I consider it
correct. We could improve the error, but what should it say?

I don't know, but std outputs​:

JimmyZ std​: s[ea] = "rea"; .say
p6eval std f43a358​: OUTPUT«Can't bless non-reference value at
CursorBase.pm line 1163.␤FAILED 00​:00 41m␤»

@p6rt
Copy link
Author

p6rt commented Aug 5, 2012

From @moritz

On Sun Aug 05 04​:53​:55 2012, jimmy wrote​:

在 2012-08-04 02​:12​:41 星期六 时,moritz 写到:

On 08/04/2012 10​:38 AM, Jimmy Zhuo (via RT) wrote​:

# New Ticket Created by "Jimmy Zhuo"
# Please include the string​: [perl #​114388]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=114388 >

JimmyZ_ r​: s[ea] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«No such method 'subst' for invocant of
type 'Any'␤ in block at /tmp/htGuR5us8T​:1␤␤»

What would you expect?
The spec says that s[] desugars to a call to 'subst', so I consider it
correct. We could improve the error, but what should it say?

I don't know, but std outputs​:

JimmyZ std​: s[ea] = "rea"; .say
p6eval std f43a358​: OUTPUT«Can't bless non-reference value at
CursorBase.pm line 1163.␤FAILED 00​:00 41m␤»

Which is even less useful, because it's an internal error from STD

@p6rt
Copy link
Author

p6rt commented Feb 7, 2013

From @FROGGS

On Sa. 04. Aug. 2012, 01​:38​:44, jimmy.zhuo@​gmail.com wrote​:

JimmyZ_ r​: s[ea] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«No such method 'subst' for invocant of
type 'Any'␤ in block at /tmp/htGuR5us8T​:1␤␤»

Maybe it should mention $_ somewhere, since it tries to call subst on $_.
<FROGGS> r​: $_ = "real"; s[ea] = "rea"; .say
<p6eval> rakudo 4fb07b​: OUTPUT«rreal␤»

JimmyZ_ r​: $_ = ""; s[] = "rea"; .say
p6eval rakudo 1f662c​: OUTPUT«===SORRY!===␤Unrecognized regex
metacharacter ] (must be quoted to match literally) at line 2, near "
= \"rea\"; "␤»
<FROGGS> r​: $_ = ""; s[] = "rea"; .say
<p6eval> rakudo 4fb07b​: OUTPUT«===SORRY!===␤Null regex not allowed␤at
/tmp/RMeRW9M9Mh​:1␤------> $_ = ""; s[⏏] = "rea"; .say␤ expecting any
of​:␤ postfix␤ infix or meta-infix␤ infix stopper␤
  statement end␤ statement modifie…

This is right IMO.

@p6rt
Copy link
Author

p6rt commented Apr 9, 2015

From @usev6

All those evaluations look good to me now​:

$ perl6 -e 's[ea] = "rea"; .say; .perl.say'

""

$ perl6 -e '$_ = "real"; s[ea] = "rea"; .say'
rreal

$ perl6-m -e '$_ = ""; s[] = "rea"'
===SORRY!=== Error while compiling -e
Null regex not allowed
at -e​:1
------> $_ = ""; s[⏏] = "rea"

I added tests for those to S05-substitution/subst.t with commit Raku/roast@78780eee60.

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 9, 2015

From @usev6

All those evaluations look good to me now​:

$ perl6 -e 's[ea] = "rea"; .say; .perl.say'

""

$ perl6 -e '$_ = "real"; s[ea] = "rea"; .say'
rreal

$ perl6-m -e '$_ = ""; s[] = "rea"'
===SORRY!=== Error while compiling -e
Null regex not allowed
at -e​:1
------> $_ = ""; s[⏏] = "rea"

I added tests for those to S05-substitution/subst.t with commit Raku/roast@78780eee60.

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Apr 9, 2015

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

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

From @usev6

The first evaluation fails again (no method 'subst-mutate' nowadays), so I'm re-opening this ticket.

$ perl6 -e 's[ea] = "rea";'
Method 'subst-mutate' not found for invocant of class 'Any'
  in block <unit> at -e​:1

We're back to "We could improve the error, but what should it say" (moritz, 2012) and "Maybe it should mention $_ somewhere, since it tries to call subst on $_" (FROGGS, 2013).

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

From @usev6

The first evaluation fails again (no method 'subst-mutate' nowadays), so I'm re-opening this ticket.

$ perl6 -e 's[ea] = "rea";'
Method 'subst-mutate' not found for invocant of class 'Any'
  in block <unit> at -e​:1

We're back to "We could improve the error, but what should it say" (moritz, 2012) and "Maybe it should mention $_ somewhere, since it tries to call subst on $_" (FROGGS, 2013).

@p6rt
Copy link
Author

p6rt commented Apr 17, 2015

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

@p6rt
Copy link
Author

p6rt commented Aug 31, 2016

From @coke

On Fri Apr 17 03​:58​:32 2015, bartolin@​gmx.de wrote​:

The first evaluation fails again (no method 'subst-mutate' nowadays),
so I'm re-opening this ticket.

$ perl6 -e 's[ea] = "rea";'
Method 'subst-mutate' not found for invocant of class 'Any'
in block <unit> at -e​:1

We're back to "We could improve the error, but what should it say"
(moritz, 2012) and "Maybe it should mention $_ somewhere, since it
tries to call subst on $_" (FROGGS, 2013).

Message changed again​:

13​:40 < [Coke]> m​: s[ea] = "rea"; # RT #​114388
13​:40 < camelia> rakudo-moar af4c2e​: OUTPUT«Method 'match' not found for
  invocant of class 'Any'␤ in block <unit> at <tmp> line 1␤␤»

--
Will "Coke" Coleda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant