github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
kawaii I don't know if here or #raku is the best place to ask for help about this, but I'm getting the following error today from one of my Perl 6 programs and I have no idea why or what it means :D 10:43
`MoarVM panic: Internal error: Unwound entire stack and missed handler`
moritz it means you've hit a bug in the rakudo + moarvm combo
kawaii it happens as a result of `return $m;` here, if that helps :) www.irccloud.com/pastebin/U36KytR6/
moritz ... but I guess you knew that already :D
kawaii: that return returns out of the outer routine, not just the callback you passed to .then(). Intentional? 10:44
kawaii moritz: seems that we weren't aware of that behaviour, thanks for that information :) 10:49
moritz kawaii: if you replace the 'return $m' by just '$m', you might be fine
trying to return from a routine that might have already exited might cause weird behavior (though I'd actually hope rakudo would catch such cases) 10:50
kawaii moritz: yep, seems like using just `$m;` fixed my issue there, thanks :)
moritz you're welcome 10:51
nwc10 but even the wrong code still should not panic, surely? 10:53
oh, hangon, you sort of said that with different words 10:54
moritz I tried :D 10:56
Altreus I think I got confused between P5 and Raku behaviour 11:09
I assumed that it was a real sub that gets passed to then, but I guess it's just a block
Is it always a block when you do -> { }? So return will never apply to that construct but the outer one? 11:10
moritz correct 11:20
bu fo course you write .then(sub ($p) { ... }) to ues a "full" subroutine 11:21
Altreus I see! I had misunderstood -> {} to be a shorthand to a sub 14:24
cos of the params you see 14:25
lizmat Altreus: you should consider the sub / method syntax as a special case of the generic block syntax, not the other way around 14:26
Altreus ah! OK :)
jnthn The type system even agrees :) 14:27
m: say Sub.^mro
camelia ((Sub) (Routine) (Block) (Code) (Any) (Mu))
Altai-man_ Altreus, don't want to be a villain, but $channel...
Altreus for sure :) 17:42
Didn't know whether to maintain context or maintain encapsulation 17:43
The eternal dilemma