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

Quotes should suppress pair creation in captures in Rakudo #3483

Closed
p6rt opened this issue Aug 18, 2014 · 4 comments
Closed

Quotes should suppress pair creation in captures in Rakudo #3483

p6rt opened this issue Aug 18, 2014 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 18, 2014

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

Searchable as RT122555$

@p6rt
Copy link
Author

p6rt commented Aug 18, 2014

From @masak

<lizmat> m​: sub a ($a,$b) { say $a; say $b }; my $c = \(42, b=> 1);
a(|$c) # this should never work, right? (receiving a pair in $b)
<camelia> rakudo-moar ddfb57​: OUTPUT«Not enough positional parameters
passed; got 1 but expected 2 [...]
* lizmat is looking at a possible bogus test in "t/spec/S02-types/capture.t
<TimToady> yes, incorrect
<lizmat> => is a Pair creator, not? regardless of quoting or nor ?
<TimToady> but quotes or parens should suppress named arg interpretation
<lizmat> so that would indicate a problem in the capture creation
<TimToady> m​: my $c = \(42, "b" => 1); say $c.elems
<camelia> rakudo-moar ddfb57​: OUTPUT«1␤»
<TimToady> m​: my $c = \(42, "b" => 1); say $c.keys
<camelia> rakudo-moar ddfb57​: OUTPUT«0 b␤»
<TimToady> that's wrong
<TimToady> should have 2 elems, and the 2nd should just be a pair
* masak submits rakudobug
* TimToady is kinda surprised it's working in Real Life when it's not
working there
<TimToady> implies there are two code paths where there probably oughta be one

@p6rt
Copy link
Author

p6rt commented Mar 30, 2015

From @jnthn

On Mon Aug 18 10​:09​:12 2014, masak wrote​:

<lizmat> m​: sub a ($a,$b) { say $a; say $b }; my $c = \(42, b=> 1);
a(|$c) # this should never work, right? (receiving a pair in $b)
<camelia> rakudo-moar ddfb57​: OUTPUT«Not enough positional parameters
passed; got 1 but expected 2 [...]
* lizmat is looking at a possible bogus test in "t/spec/S02-
types/capture.t
<TimToady> yes, incorrect
<lizmat> => is a Pair creator, not? regardless of quoting or nor ?
<TimToady> but quotes or parens should suppress named arg
interpretation
<lizmat> so that would indicate a problem in the capture creation
<TimToady> m​: my $c = \(42, "b" => 1); say $c.elems
<camelia> rakudo-moar ddfb57​: OUTPUT«1␤»
<TimToady> m​: my $c = \(42, "b" => 1); say $c.keys
<camelia> rakudo-moar ddfb57​: OUTPUT«0 b␤»
<TimToady> that's wrong
<TimToady> should have 2 elems, and the 2nd should just be a pair
* masak submits rakudobug

The test is now passing and unfudged.

* TimToady is kinda surprised it's working in Real Life when it's not
working there
<TimToady> implies there are two code paths where there probably
oughta be one

Indeed, and now there is one code-path as of Rakudo commit 253bb58.

Resolvin'

@p6rt
Copy link
Author

p6rt commented Mar 30, 2015

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

@p6rt
Copy link
Author

p6rt commented Mar 30, 2015

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

@p6rt p6rt closed this as completed Mar 30, 2015
@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