2010-03-30

act'rec as implicit parameter to coroutine

3.11: adda/translation/coroutines/act'rec as implicit parameter:
. after seeing coroutines for c
I saw a way that uses
another implicit parameter:
the param is a record of
all the routine's needed locals,
along with a yield pointer .
. it returns that record,
and then is called with the same record .
. when called again with the same record,
it uses the yield pointer to jump to where it left off .
. this gets a bit messy when
the yield is inside loops:
this is not really a problem with c,
where loops are very primitive:
a for-loop is just a while-loop is just a
combination goto and conditional
-- you can goto anywhere .

No comments:

Post a Comment