1 # Copyright (C) 2001-2005, Parrot Foundation.
6 examples/pasm/coroutine.pasm - Sample co-routines in Parrot
10 % ./parrot examples/pasm/coroutine.pasm
14 This shows you how to create two coroutines and C<invoke> them.
19 F<docs/pdds/pdd03_calling_conventions.pod>
23 # create a coro and save it on the user stack
24 .const 'Sub' P0 = "MYCOROUTINE"
25 # a coroutine carries state - clone it
28 # create a second coro
31 # Calling convention says P0 will contain the sub so..
32 print "Calling 1st co-routine\n"
37 print "Calling 2nd co-routine\n"
57 # vim: expandtab shiftwidth=4 ft=pir: