quakeforge/ruamoko/scheme/BaseContinuation.r

30 lines
481 B
R
Raw Permalink Normal View History

#include "BaseContinuation.h"
#include "Cons.h"
instruction_t returninst;
2011-02-14 13:39:43 +00:00
BaseContinuation *base;
@implementation BaseContinuation
+ (void) initialize
{
returninst.opcode = RETURN;
base = [BaseContinuation new];
}
+ (id) baseContinuation
{
return base;
}
2011-02-14 13:39:43 +00:00
- (void) restoreOnMachine: (Machine *) m
{
[m state].program = &returninst;
}
2011-02-14 13:39:43 +00:00
- (void) invokeOnMachine: (Machine *) m
{
2011-02-14 13:39:43 +00:00
[m value: [(Cons *) [m stack] car]];
[m state].program = &returninst;
}
@end