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

Matching a regex in a scalar returns Bool instead of Match #4956

Closed
p6rt opened this issue Dec 29, 2015 · 6 comments
Closed

Matching a regex in a scalar returns Bool instead of Match #4956

p6rt opened this issue Dec 29, 2015 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 29, 2015

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

Searchable as RT127071$

@p6rt
Copy link
Author

p6rt commented Dec 29, 2015

From @labster

A regression sometime since September (the last Star release) broke
Lingua​::Number (among other things, but this one isn't my fault :))

06​:05 labster m​: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar"
~~ /foo/) #anyone know why these are different?
06​:05 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤»
06​:06 skids /foo/ is like m/foo/
06​:07 skids Though... hmm.
06​:08 skids m​: say("foobar" ~~ rx/foo/); say("foobar" ~~ /foo/)
06​:08 camelia rakudo-moar 16c5fc​: OUTPUT«「foo」␤「foo」␤»
06​:09 skids m​: my $v := rx/foo/; say("foobar" ~~ $v); say("foobar"
~~ /foo/)
06​:09 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤»
06​:09 skids That is weird.
06​:10 labster It's witchcraft.
06​:10 skids We'll have to get a wizard ruling on that.
06​:10 labster Anyone in here wearing a WIZZARD hat?
06​:11 * sumdumgoi puts on robe and... nope, can't find wizard hat!
:P
06​:12 skids m​: my $v = rx/foo/; say("foobar" ~~ $v); $/.say;
say("foobar" ~~ /foo/); $/.say
06​:12 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤「foo」␤「foo」␤»
06​:13 labster sumdumgoi​: here, 🎩 will have to do
06​:13 * sumdumgoi dons magician's hat 🎩
06​:14 labster skids​: this is what is currently breaking
Lingua​::Number, but I have no idea when the regression happened because I
let my module bitrot a while.
06​:14 skids star​: m​: my $v = rx/foo/; say("foobar" ~~ $v); $/.say;
say("foobar" ~~ /foo/); $/.say
06​:14 camelia star-m 2015.09​: OUTPUT«「foo」␤「foo」␤「foo」␤「foo」␤»
06​:14 skids Well, since September
06​:14 labster Ah, not *that* bad.

@p6rt
Copy link
Author

p6rt commented Jan 18, 2016

From @skids

At http://irclog.perlgeek.de/perl6/2016-01-18#i_11901877 pierre-vigier++ shows that
this sometimes also affects $/

$ perl6 -e 'my $r = rx/a/; my $a = "a" ~~ $r; say $a; say $/'
True
「a」
$ perl6 -e 'my $h = test => "plop"; my $rule = rx{ ^ $&lt;tt>=[plop] $ }; my $match = $h<test> ~~ $rule; say $match; say $/; '
True
Nil
$ perl6 -e 'my $h = test => "plop"; my $match = $h&lt;test&gt; ~~ rx{ ^ $&lt;tt>=[plop] $ }; say $match; say $/; '
「plop」
tt => 「plop」
「plop」
tt => 「plop」

@p6rt
Copy link
Author

p6rt commented Jan 18, 2016

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

@p6rt
Copy link
Author

p6rt commented Oct 27, 2016

From @labster

On the original bug, bisectable suggests f457007181bb might have caused this ("allow ~~ to chain where practical")

01​:32 labster viki​: Thanks for asking, anyway, about Lingua​::Number. For bonus points, you can fix the bug​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127071
01​:33 m​: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/)
01​:33 camelia rakudo-moar a1fcee​: OUTPUT«True␤「foo」␤»
01​:37 MasterDuke bisectable6​: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/)
01​:37 bisectable6 MasterDuke, On both starting points (old=2015.12 new=b7201a8) the exit code is 0 and the output is identical as well
01​:37 MasterDuke, Output on both points​: True␤「foo」
01​:38 MasterDuke bisectable6​: old=2015.07 new=2015.12 my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/)
01​:38 bisectable6 MasterDuke, Bisecting by output (old=2015.07 new=2015.12) because on both starting points the exit code is 0
01​:38 MasterDuke, bisect log​: https://gist.github.com/3ac9​27ee99178823f595a1ee0810cedb
01​:38 MasterDuke, (2015-12-10) rakudo/rakudo@​f457007181bb6e2dcb6aefe857f36d648ae38401

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

From @labster

Fixed in 5ac593ee0. Tests in 839566cf. Resolving ticket.

On Tue, 29 Dec 2015 00​:09​:48 -0800, labster wrote​:

A regression sometime since September (the last Star release) broke
Lingua​::Number (among other things, but this one isn't my fault :))

06​:05 labster m​: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar"
~~ /foo/) #anyone know why these are different?
06​:05 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤»
06​:06 skids /foo/ is like m/foo/
06​:07 skids Though... hmm.
06​:08 skids m​: say("foobar" ~~ rx/foo/); say("foobar" ~~ /foo/)
06​:08 camelia rakudo-moar 16c5fc​: OUTPUT«「foo」␤「foo」␤»
06​:09 skids m​: my $v := rx/foo/; say("foobar" ~~ $v); say("foobar"
~~ /foo/)
06​:09 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤»
06​:09 skids That is weird.
06​:10 labster It's witchcraft.
06​:10 skids We'll have to get a wizard ruling on that.
06​:10 labster Anyone in here wearing a WIZZARD hat?
06​:11 * sumdumgoi puts on robe and... nope, can't find wizard hat!
:P
06​:12 skids m​: my $v = rx/foo/; say("foobar" ~~ $v); $/.say;
say("foobar" ~~ /foo/); $/.say
06​:12 camelia rakudo-moar 16c5fc​: OUTPUT«True␤「foo」␤「foo」␤「foo」␤»
06​:13 labster sumdumgoi​: here, 🎩 will have to do
06​:13 * sumdumgoi dons magician's hat 🎩
06​:14 labster skids​: this is what is currently breaking
Lingua​::Number, but I have no idea when the regression happened because I
let my module bitrot a while.
06​:14 skids star​: m​: my $v = rx/foo/; say("foobar" ~~ $v); $/.say;
say("foobar" ~~ /foo/); $/.say
06​:14 camelia star-m 2015.09​: OUTPUT«「foo」␤「foo」␤「foo」␤「foo」␤»
06​:14 skids Well, since September
06​:14 labster Ah, not *that* bad.

@p6rt
Copy link
Author

p6rt commented Nov 22, 2016

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

@p6rt p6rt closed this as completed Nov 22, 2016
@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