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

Stringification of AST parameter not captured properly in postfix macro in Rakudo #3512

Closed
p6rt opened this issue Sep 10, 2014 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Sep 10, 2014

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

Searchable as RT122746$

@p6rt
Copy link
Author

p6rt commented Sep 10, 2014

From @masak

<masak> m​: macro postfix​:<!!>($o) { quasi { die "Null check failed for
", $o.Str unless defined {{{$o}}}; {{{$o}}} } }; say 42!!; my
$cookies; my $food = $cookies!!
16​:18 <+camelia> rakudo-moar 51ddd5​: OUTPUT«42␤Null check failed for ␤
in any [...]»
<masak> so close.
* masak submits rakudobug
<masak> (it should capture the string '$cookies' in $o.Str, IMO)
<masak> that is, the error message shoulda been 'Null check failed for $cookies'

@p6rt
Copy link
Author

p6rt commented Oct 2, 2014

From @masak

masak (>)​:

<masak> m​: macro postfix​:<!!>($o) { quasi { die "Null check failed for
", $o.Str unless defined {{{$o}}}; {{{$o}}} } }; say 42!!; my
$cookies; my $food = $cookies!!
16​:18 <+camelia> rakudo-moar 51ddd5​: OUTPUT«42␤Null check failed for ␤
in any [...]»
<masak> so close.
* masak submits rakudobug
<masak> (it should capture the string '$cookies' in $o.Str, IMO)
<masak> that is, the error message shoulda been 'Null check failed for
$cookies'

This works now, thanks for moritz++.

$ cat RT-122746-code
macro postfix​:<!!>($o) {
  quasi {
  die "Null check failed for ", $o.Str
  unless defined {{{$o}}};
  {{{$o}}}
  }
}

say 42!!;

my $cookies;
my $food = $cookies!!
masak@​siddharta ~/mine/macro-grant $ perl6 RT-122746-code
42
Null check failed for $cookies
  in any at RT-122746-code​:3
  in block <unit> at RT-122746-code​:12

Marking ticket as testneeded.

@p6rt
Copy link
Author

p6rt commented Oct 23, 2014

From @usev6

There is a passing test in S06-macros/unquoting.t now (cmp. commits Raku/roast@054665cfb7 and Raku/roast@d6570538ae).

I'm closing this ticket now.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 23, 2014

From @usev6

There is a passing test in S06-macros/unquoting.t now (cmp. commits Raku/roast@054665cfb7 and Raku/roast@d6570538ae).

I'm closing this ticket now.

@p6rt
Copy link
Author

p6rt commented Oct 23, 2014

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

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