Further datapoints:
$ perl6
To exit type 'exit' or '^D'
> sub postfix:<€> (Int $n) {2*$n}; say 42€
84
> say postfix:<€> (42)
84
So, the sub *does* survive from one call to the next. It only loses the
grammar adaptations that defining a sub postfix:<> do.
> On 15 Aug 2017, at 21:06, Elizabeth Mattijsen <[email protected]> wrote:
>
> This appears to be forgetfulness of the REPL from one input to the next. If
> you put it on the same line, it *does* work:
>
>> sub postfix:<€> (Int $n) {2*$n}; say 42€
> 84
>
> So this boils down to a much more generic issue, for which we already have
> tickets I believe.
>
>> On 15 Aug 2017, at 14:25, Patrick Tonnerre (via RT)
>> <[email protected]> wrote:
>>
>> # New Ticket Created by Patrick Tonnerre
>> # Please include the string: [perl #131900]
>> # in the subject line of all future correspondence about this issue.
>> # <URL: https://rt.perl.org/Ticket/Display.html?id=131900 >
>>
>>
>> Hi,
>>
>> context is :
>> MBP running macOS Sierra 10.12.6
>> RakudoStar dmg installed
>> This is Rakudo version 2017.07 built on MoarVM version 2017.07
>> implementing Perl 6.c.
>>
>> When executing the following commands under REPL, i got that issue :
>>> sub postfix:<€> (Int $n) {2*$n};
>> sub postfix:<€> (Int $n) { #`(Sub+{Precedence}|140257667062944) ... }
>>> say 21€
>> ===SORRY!=== Error while compiling:
>> Bogus postfix
>> ------> say 21⏏€
>> expecting any of:
>> infix
>> infix stopper
>> postfix
>> statement end
>> statement modifier
>> statement modifier loop
>>
>> Running the same statements into a script is working fine :
>> #!/usr/bin/env perl6
>>
>> sub postfix:<€> (Int $n) {2*$n}
>>
>> say 21€;
>>
>> ./operators.pl6
>> 42
>>
>> Regards
>> —
>> Patrick