quakeforge/ruamoko/scheme/Primitive.r
Bill Currie 75ec6bf244 Clean out some unnecessary types from the progs engine and clean up the mess.
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00

31 lines
578 B
R

#include "Primitive.h"
#include "Machine.h"
#include "Continuation.h"
@implementation Primitive
+ (id) newFromFunc: (primfunc_t) f
{
return [[self alloc] initWithFunc: f];
}
- (id) initWithFunc: (primfunc_t) f
{
self = [super init];
func = f;
return self;
}
- (SchemeObject[]) invokeOnMachine: (Machine[]) m
{
local SchemeObject []value = func ([m stack], m);
[super invokeOnMachine: m];
if (value) {
[m value: value];
[[m continuation] restoreOnMachine: m];
}
}
- (string) printForm
{
return "<primitive>";
}
@end