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

whatever auto closure fails with smartmatch with regex #6296

Closed
p6rt opened this issue May 31, 2017 · 8 comments
Closed

whatever auto closure fails with smartmatch with regex #6296

p6rt opened this issue May 31, 2017 · 8 comments

Comments

@p6rt
Copy link

p6rt commented May 31, 2017

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

Searchable as RT131409$

@p6rt
Copy link
Author

p6rt commented May 31, 2017

From zengargoyle@gmail.com

When using smartmatch against a regex, auto-whatever closure generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a


zengargoyle

@p6rt
Copy link
Author

p6rt commented May 31, 2017

From @zoffixznet

On Wed, 31 May 2017 03​:31​:49 -0700, zengargoyle@​gmail.com wrote​:

When using smartmatch against a regex, auto-whatever closure generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a

----
zengargoyle

This feels very related to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126984

@p6rt
Copy link
Author

p6rt commented May 31, 2017

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

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

From @skids

On Wed, 31 May 2017 03​:47​:19 -0700, cpan@​zoffix.com wrote​:

On Wed, 31 May 2017 03​:31​:49 -0700, zengargoyle@​gmail.com wrote​:

When using smartmatch against a regex, auto-whatever closure generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a

----
zengargoyle

This feels very related to https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126984

Fudged tests preemptively added to S02-types/whatever.t in roast commit 4b2fef409.

@p6rt
Copy link
Author

p6rt commented Feb 2, 2018

From @zoffixznet

On Thu, 14 Sep 2017 19​:19​:47 -0700, bri@​abrij.org wrote​:

On Wed, 31 May 2017 03​:47​:19 -0700, cpan@​zoffix.com wrote​:

On Wed, 31 May 2017 03​:31​:49 -0700, zengargoyle@​gmail.com wrote​:

When using smartmatch against a regex, auto-whatever closure
generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a

----
zengargoyle

This feels very related to
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126984

Fudged tests preemptively added to S02-types/whatever.t in roast
commit 4b2fef409.

Golfed to `<foo bar>.map({ * ~~ /<$_>/ }).eager.head.("foo").say`

Should say True, but says False

@p6rt
Copy link
Author

p6rt commented Feb 2, 2018

From @zoffixznet

On Thu, 01 Feb 2018 17​:37​:43 -0800, cpan@​zoffix.com wrote​:

On Thu, 14 Sep 2017 19​:19​:47 -0700, bri@​abrij.org wrote​:

On Wed, 31 May 2017 03​:47​:19 -0700, cpan@​zoffix.com wrote​:

On Wed, 31 May 2017 03​:31​:49 -0700, zengargoyle@​gmail.com wrote​:

When using smartmatch against a regex, auto-whatever closure
generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a

----
zengargoyle

This feels very related to
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126984

Fudged tests preemptively added to S02-types/whatever.t in roast
commit 4b2fef409.

Golfed to `<foo bar>.map({ * ~~ /<$_>/ }).eager.head.("foo").say`

Should say True, but says False

I meant it should match, but says Nil

@p6rt
Copy link
Author

p6rt commented Feb 2, 2018

From @zoffixznet

On Wed, 31 May 2017 03​:31​:49 -0700, zengargoyle@​gmail.com wrote​:

When using smartmatch against a regex, auto-whatever closure generation
does not work whereas manual pointy closure does work.

A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'.
However, '-> $x { $x ~~ <$match>}' behaves as expected.

For a test case​:
https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a

----
zengargoyle

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@d80fc376d201056
Test​: Raku/roast@323a2b65948f05d62

@p6rt p6rt closed this as completed Feb 2, 2018
@p6rt
Copy link
Author

p6rt commented Feb 2, 2018

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

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

No branches or pull requests

1 participant