Waw! :) Following your examples and suggestions, these work:

> class { submethod TWEAK(-->Nil) { Any.map: {say 99}  } }.new;
> class { submethod TWEAK { sink Any.map: {say 99}  } }.new;
> class { submethod TWEAK { eager Any.map: {say 99}  } }.new;

I really appreciate your discussion. Let me know if you think it is worth
to include this issue in the TWEAK Raku documentation.

Thanks very much for the detailed explanation.

Cheers!


Missatge de Ralph Mellor <ralphdjmel...@gmail.com> del dia dg., 14 de març
2021 a les 23:00:

> On Sun, Mar 14, 2021 at 2:12 AM Brad Gilbert <b2gi...@gmail.com> wrote:
> >
> > Ralph, the last value in all functions are not sunk by default,
> > so of course the last one in `TWEAK` is not sunk by default.
>
> Right. Thanks for correcting this misleading part of my explanation.
>
> > The bug is that the calling code is not sinking the result.
>
> The code that normally calls BUILD and TWEAK is shipped with
> standard Raku settings. It isn't sinking the result. That sounds like
> a bug to me. Though perhaps it's not one worth considering fixing
> this side of RakuAST landing with its new sink handling code that
> will, with luck, have higher performance.
>
> (That is what I was trying to say, but it was 3am...)
>
> --
> love, raiph
>

Reply via email to