I don't know about the continuation stuff, but you can't assume that
running imc --> pasm --> exec does the same thing as imc --> exec. I
ran into that before, and I don't think its going to get fixed until
the new imcc lands, at which point old-school pasm might even be
gone (although I don't know that I'm remembering that part right).


Regards,

-- Gregor

On Sun, 2004-03-21 at 08:53, Piers Cawley wrote:
> So, I'm trying to get my head 'round parrot's continuations. It's my
> understanding that, at creation time, a Continuation closes over the
> current user stacks, control stack and lexical pad (and possibly some
> other stuff but those'll do for now). 
> 
> So, it seems to me that the following code should print "Howdy,
> world". 
> 
>   .sub main
>     $P0 = new PerlUndef
>     $P0 = "Howdy, world\n"
>     save $P0
>     $P1 = newcont after
>   #    $P1 = new .Continuation
>   #    set_addr $P1, after
>     invoker($P1)
>   sub_end:
>     .pcc_begin_return
>     .pcc_end_return
> 
>   after:
>     restore $P2
>     print $P2
>     branch sub_end
>   .end
> 
>   .sub invoker 
>     .param pmc a_cont
>     invoke a_cont
>     .pcc_begin_return
>     .pcc_end_return
>   .end
> 
> Except, what actually happens is: 
> 
> Parrot VM: PANIC: Illegal rethrow!
> C file src/exceptions.c, line 356                                                 
> Parrot file (unknown file), line 0
> 
> Which isn't quite what I had in mind. Bizarrely, if I do:
> 
> $ parrot -o howdy.pasm howdy.imc
> $ parrot howdy.pasm
> Howdy, world
> $
> 
> everything's fine.
> 
> Weird hunh?
-- 
Gregor Purdy                            [EMAIL PROTECTED]
Focus Research, Inc.               http://www.focusresearch.com/

Reply via email to