summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKCompiledClosure.m27
-rw-r--r--MLKLLVMCompiler.h4
-rw-r--r--MLKLLVMCompiler.mm96
-rw-r--r--MLKLexicalContext-MLKLLVMCompilation.mm2
-rw-r--r--MLKRoot.m102
5 files changed, 136 insertions, 95 deletions
diff --git a/MLKCompiledClosure.m b/MLKCompiledClosure.m
index b379dd3..4a59f7d 100644
--- a/MLKCompiledClosure.m
+++ b/MLKCompiledClosure.m
@@ -17,6 +17,7 @@
*/
#import "MLKCompiledClosure.h"
+#import "MLKCons.h"
#import "functions.h"
#import "globals.h"
@@ -66,23 +67,28 @@
-(NSArray *) applyToArray:(NSArray *)arguments
{
- int argc = ([arguments count] + 2);
+ int argc = ([arguments count] + 3);
ffi_cif cif;
ffi_type *arg_types[argc];
ffi_status status;
void *argv[argc];
- id argpointers[argc - 1];
+ id argpointers[argc - 2];
ffi_arg return_value;
int i;
+ id return_values = nil;
+ id *return_values_ptr = &return_values;
arg_types[0] = &ffi_type_pointer;
argv[0] = &m_data;
+
+ arg_types[1] = &ffi_type_pointer;
+ argv[1] = &return_values_ptr;
- for (i = 1; i < argc - 1; i++)
+ for (i = 2; i < argc - 1; i++)
{
arg_types[i] = &ffi_type_pointer;
- argpointers[i-1] = denullify([arguments objectAtIndex:(i-1)]);
- argv[i] = &argpointers[i-1];
+ argpointers[i-2] = denullify([arguments objectAtIndex:(i-2)]);
+ argv[i] = &argpointers[i-2];
}
arg_types[argc - 1] = &ffi_type_pointer;
@@ -104,8 +110,15 @@
ffi_call (&cif, FFI_FN (m_code), &return_value, (void**)argv);
// return_value = ((id (*)(void *, ...))_code) (_data, argpointers[0], argpointers[1], MLKEndOfArgumentsMarker);
- // FIXME: multiple values
- return [NSArray arrayWithObject:nullify((id)return_value)];
+ if (return_values)
+ {
+ MLKCons *values = [return_values cdr];
+ return (values ? [values array] : [NSArray array]);
+ }
+ else
+ {
+ return [NSArray arrayWithObject:nullify((id)return_value)];
+ }
}
-(NSString *) description
diff --git a/MLKLLVMCompiler.h b/MLKLLVMCompiler.h
index 44f1b33..e0ff2d4 100644
--- a/MLKLLVMCompiler.h
+++ b/MLKLLVMCompiler.h
@@ -84,7 +84,7 @@ using namespace llvm;
#ifdef __cplusplus
@interface MLKForm (MLKLLVMCompilation)
--(Value *) processForLLVM;
--(Value *) reallyProcessForLLVM;
+-(Value *) processForLLVMWithMultiValue:(Value *)multiValue;
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue;
@end
#endif
diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm
index da4710d..e463a65 100644
--- a/MLKLLVMCompiler.mm
+++ b/MLKLLVMCompiler.mm
@@ -225,7 +225,7 @@ static Constant
+(Value *) processForm:(MLKForm *)form
{
- return [form processForLLVM];
+ return [form processForLLVMWithMultiValue:NULL];
}
+(void) markVariablesForHeapAllocationInForm:(MLKForm *)form
@@ -414,7 +414,7 @@ static Constant
@implementation MLKForm (MLKLLVMCompilation)
--(Value *) processForLLVM
+-(Value *) processForLLVMWithMultiValue:(Value *)multiValue
{
#if 0
[_compiler insertTrace:
@@ -422,7 +422,7 @@ static Constant
@"Executing: %@", MLKPrintToString(_form)]];
#endif
- Value *result = [self reallyProcessForLLVM];
+ Value *result = [self reallyProcessForLLVMWithMultiValue:multiValue];
#if 0
[_compiler insertTrace:
@@ -433,7 +433,7 @@ static Constant
return result;
}
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSLog (@"WARNING: Unrecognised form type: %@", self);
return NULL;
@@ -442,15 +442,21 @@ static Constant
@implementation MLKProgNForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSEnumerator *e = [_bodyForms objectEnumerator];
MLKForm *form;
Value *value = ConstantPointerNull::get (VoidPointerTy);
+ int i;
+ i = 0;
while ((form = [e nextObject]))
{
- value = [form processForLLVM];
+ i++;
+ if (i == [_bodyForms count])
+ value = [form processForLLVMWithMultiValue:multiValue];
+ else
+ value = [form processForLLVMWithMultiValue:NULL];
}
return value;
@@ -459,7 +465,7 @@ static Constant
@implementation MLKSimpleLoopForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSEnumerator *e = [_bodyForms objectEnumerator];
MLKForm *form;
@@ -474,7 +480,7 @@ static Constant
while ((form = [e nextObject]))
{
- [form processForLLVM];
+ [form processForLLVMWithMultiValue:NULL];
}
builder.CreateBr (loopBlock);
@@ -489,7 +495,7 @@ static Constant
@implementation MLKSymbolForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
Value *value;
@@ -537,7 +543,7 @@ static Constant
@implementation MLKFunctionCallForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
Value *functionPtr;
Value *closureDataPtr;
@@ -582,7 +588,7 @@ static Constant
Value *code = builder.CreateLoad (codeptr, "closure_code");
Value *data = builder.CreateLoad (dataptr, "closure_data");
- std::vector<const Type *> types (1, PointerPointerTy);
+ std::vector<const Type *> types (2, PointerPointerTy);
functionPtr = builder.CreateBitCast (code, PointerType::get(FunctionType::get(VoidPointerTy,
types,
true),
@@ -594,13 +600,17 @@ static Constant
//[_compiler insertPointerTrace:functionPtr];
args.push_back (closureDataPtr);
+ if (multiValue)
+ args.push_back (multiValue);
+ else
+ args.push_back (ConstantPointerNull::get (PointerPointerTy));
NSEnumerator *e = [_argumentForms objectEnumerator];
MLKForm *form;
while ((form = [e nextObject]))
{
- args.push_back ([form processForLLVM]);
+ args.push_back ([form processForLLVMWithMultiValue:NULL]);
}
//GlobalVariable *endmarker = module->getGlobalVariable ("MLKEndOfArgumentsMarker", false);
@@ -649,7 +659,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
MLKLexicalContext *_context = [processed_form context];
id _compiler = [MLKLLVMCompiler class];
- vector <const Type *> argtypes (1, PointerPointerTy);
+ vector <const Type *> argtypes (2, PointerPointerTy);
FunctionType *ftype = FunctionType::get (VoidPointerTy, argtypes, true);
function = Function::Create (ftype,
Function::InternalLinkage,
@@ -659,6 +669,9 @@ build_simple_function_definition (MLKBodyForm *processed_form,
Function::arg_iterator args = function->arg_begin();
Value *closure_data_arg = args++;
closure_data_arg->setName ("closure_data");
+
+ Value *functionMultiValue = args++;
+ functionMultiValue->setName ("function_multiple_value_return_pointer");
BasicBlock *outerBlock = builder.GetInsertBlock ();
BasicBlock *initBlock = BasicBlock::Create ("init_function", function);
@@ -803,10 +816,14 @@ build_simple_function_definition (MLKBodyForm *processed_form,
value = ConstantPointerNull::get (VoidPointerTy);
}
+ i = 0;
while ((form = [e nextObject]))
{
- //NSLog (@"%LAMBDA: Processing subform.");
- value = [form processForLLVM];
+ i++;
+ if (i == [_bodyForms count])
+ value = [form processForLLVMWithMultiValue:functionMultiValue];
+ else
+ value = [form processForLLVMWithMultiValue:NULL];
}
builder.CreateRet (value);
@@ -830,7 +847,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKSimpleLambdaForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
intptr_t closure_data_size;
Function *function;
@@ -858,7 +875,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKLetForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSEnumerator *e = [_variableBindingForms objectEnumerator];
Value *value = ConstantPointerNull::get (VoidPointerTy);
@@ -867,7 +884,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
while ((binding_form = [e nextObject]))
{
- Value *binding_value = [[binding_form valueForm] processForLLVM];
+ Value *binding_value = [[binding_form valueForm] processForLLVMWithMultiValue:NULL];
if ([_bodyContext variableHeapAllocationForSymbol:[binding_form name]])
{
@@ -892,10 +909,15 @@ build_simple_function_definition (MLKBodyForm *processed_form,
}
}
+ int i = 0;
e = [_bodyForms objectEnumerator];
while ((form = [e nextObject]))
{
- value = [form processForLLVM];
+ i++;
+ if (i == [_bodyForms count])
+ value = [form processForLLVMWithMultiValue:multiValue];
+ else
+ value = [form processForLLVMWithMultiValue:NULL];
}
return value;
@@ -904,12 +926,13 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKSimpleFletForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSEnumerator *e = [_functionBindingForms objectEnumerator];
Value *value = ConstantPointerNull::get (VoidPointerTy);
MLKForm *form;
MLKSimpleFunctionBindingForm *binding_form;
+ unsigned int i;
while ((binding_form = [e nextObject]))
{
@@ -943,11 +966,16 @@ build_simple_function_definition (MLKBodyForm *processed_form,
[_bodyContext setFunctionBindingValue:binding
forSymbol:[binding_form name]];
}
-
+
+ i = 0;
e = [_bodyForms objectEnumerator];
while ((form = [e nextObject]))
{
- value = [form processForLLVM];
+ i++;
+ if (i == [_bodyForms count])
+ value = [form processForLLVMWithMultiValue:multiValue];
+ else
+ value = [form processForLLVMWithMultiValue:NULL];
}
return value;
@@ -956,7 +984,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKQuoteForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
// FIXME: When to release _quotedData? At the same time the code is
// released, probably...
@@ -977,7 +1005,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKSelfEvaluatingForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
// FIXME: When to release _form? At the same time the code is
// released, probably...
@@ -998,25 +1026,25 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKIfForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
Function *function = builder.GetInsertBlock()->getParent();
BasicBlock *thenBlock = BasicBlock::Create ("if_then", function);
BasicBlock *elseBlock = BasicBlock::Create ("if_else");
BasicBlock *joinBlock = BasicBlock::Create ("if_join");
- Value *test = builder.CreateICmpNE ([_conditionForm processForLLVM],
+ Value *test = builder.CreateICmpNE ([_conditionForm processForLLVMWithMultiValue:NULL],
ConstantPointerNull::get (VoidPointerTy));
Value *value = builder.CreateAlloca (VoidPointerTy, NULL, "if_result");
builder.CreateCondBr (test, thenBlock, elseBlock);
builder.SetInsertPoint (thenBlock);
- builder.CreateStore ([_consequentForm processForLLVM], value);
+ builder.CreateStore ([_consequentForm processForLLVMWithMultiValue:multiValue], value);
builder.CreateBr (joinBlock);
builder.SetInsertPoint (elseBlock);
function->getBasicBlockList().push_back (elseBlock);
- builder.CreateStore ([_alternativeForm processForLLVM], value);
+ builder.CreateStore ([_alternativeForm processForLLVMWithMultiValue:multiValue], value);
builder.CreateBr (joinBlock);
builder.SetInsertPoint (joinBlock);
@@ -1028,7 +1056,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKSetQForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
NSEnumerator *var_e, *value_e;
MLKForm *valueForm;
@@ -1040,7 +1068,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
while ((valueForm = [value_e nextObject]))
{
variable = [var_e nextObject];
- value = [valueForm processForLLVM];
+ value = [valueForm processForLLVMWithMultiValue:NULL];
if (![_context variableIsLexical:variable])
{
Value *mlkdynamiccontext = [_compiler insertClassLookup:@"MLKDynamicContext"];
@@ -1127,7 +1155,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKInPackageForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
id package = [MLKPackage findPackage:stringify(_packageDesignator)];
@@ -1145,7 +1173,7 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKSimpleFunctionForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
if ([_context functionIsGlobal:_functionName])
{
@@ -1184,8 +1212,8 @@ build_simple_function_definition (MLKBodyForm *processed_form,
@implementation MLKLambdaFunctionForm (MLKLLVMCompilation)
--(Value *) reallyProcessForLLVM
+-(Value *) reallyProcessForLLVMWithMultiValue:(Value *)multiValue
{
- return [_lambdaForm processForLLVM];
+ return [_lambdaForm processForLLVMWithMultiValue:multiValue];
}
@end \ No newline at end of file
diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm
index b387f62..b2d95ea 100644
--- a/MLKLexicalContext-MLKLLVMCompilation.mm
+++ b/MLKLexicalContext-MLKLLVMCompilation.mm
@@ -55,7 +55,7 @@ id MLKDummyUseLLVMLexicalContext = nil;
-(Instruction *) functionCellValueForSymbol:(id)name
{
- std::vector<const Type *> types (1, PointerType::get(PointerType::get(Type::Int8Ty, 0), 0));
+ std::vector<const Type *> types (2, PointerType::get(PointerType::get(Type::Int8Ty, 0), 0));
return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty,
(uint64_t)[self functionCellForSymbol:name],
false),
diff --git a/MLKRoot.m b/MLKRoot.m
index 7eb9f14..5bbabdf 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -63,39 +63,39 @@ static id truify (BOOL value)
static id
-car (id *_data, id cons, id _marker)
+car (id *_data, id *_multireturn, id cons, id _marker)
{
return [cons car];
}
static id
-cdr (id *_data, id cons, id _marker)
+cdr (id *_data, id *_multireturn, id cons, id _marker)
{
return [cons cdr];
}
static id
-rplaca (id *_data, id cons, id value, id _marker)
+rplaca (id *_data, id *_multireturn, id cons, id value, id _marker)
{
[cons setCar:value];
return cons;
}
static id
-rplacd (id *_data, id cons, id value, id _marker)
+rplacd (id *_data, id *_multireturn, id cons, id value, id _marker)
{
[cons setCdr:value];
return cons;
}
static id
-cons (id *_data, id car, id cdr, id _marker)
+cons (id *_data, id *_multireturn, id car, id cdr, id _marker)
{
return [MLKCons cons:car with:cdr];
}
static id
-load (id *_data, NSString *fileName, id _marker)
+load (id *_data, id *_multireturn, NSString *fileName, id _marker)
{
BOOL success;
int l, i;
@@ -161,22 +161,22 @@ load (id *_data, NSString *fileName, id _marker)
}
static id
-require (id *_data, id moduleName, id _marker)
+require (id *_data, id *_multireturn, id moduleName, id _marker)
{
NSBundle *toiletKit = [NSBundle bundleForClass:[MLKRoot class]];
NSString *path = [[toiletKit resourcePath]
stringByAppendingPathComponent:stringify(moduleName)];
- return load (NULL, path, MLKEndOfArgumentsMarker);
+ return load (NULL, _multireturn, path, MLKEndOfArgumentsMarker);
}
static id
-eq (id *_data, id x, id y, id _marker)
+eq (id *_data, id *_multireturn, id x, id y, id _marker)
{
return truify (x == y);
}
static id
-fixnum_eq (id *_data, id x, id y, id _marker)
+fixnum_eq (id *_data, id *_multireturn, id x, id y, id _marker)
{
#ifdef NO_FIXNUMS
return truify ([x isEqual:y]);
@@ -186,95 +186,95 @@ fixnum_eq (id *_data, id x, id y, id _marker)
}
static id
-symbolp (id *_data, id arg0, id _marker)
+symbolp (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (MLKInstanceP(arg0)
&& (!arg0 || [arg0 isKindOfClass:[MLKSymbol class]]));
}
static id
-listp (id *_data, id arg0, id _marker)
+listp (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (MLKInstanceP(arg0)
&& (!arg0 || [arg0 isKindOfClass:[MLKCons class]]));
}
static id
-consp (id *_data, id arg0, id _marker)
+consp (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (MLKInstanceP(arg0)
&& [arg0 isKindOfClass:[MLKCons class]]);
}
static id
-atom (id *_data, id arg0, id _marker)
+atom (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (!MLKInstanceP(arg0)
|| ![arg0 isKindOfClass:[MLKCons class]]);
}
static id
-null (id *_data, id arg0, id _marker)
+null (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (!arg0);
}
static id
-fixnump (id *_data, id arg0, id _marker)
+fixnump (id *_data, id *_multireturn, id arg0, id _marker)
{
return truify (MLKFixnumP(arg0));
}
static id
-add (id *_data, MLKNumber *x, MLKNumber *y, id _marker)
+add (id *_data, id *_multireturn, MLKNumber *x, MLKNumber *y, id _marker)
{
return [nullify(x) add:nullify(y)];
}
static id
-subtract (id *_data, MLKNumber *x, MLKNumber *y, id _marker)
+subtract (id *_data, id *_multireturn, MLKNumber *x, MLKNumber *y, id _marker)
{
return [nullify(x) subtract:nullify(y)];
}
static id
-multiply (id *_data, MLKNumber *x, MLKNumber *y, id _marker)
+multiply (id *_data, id *_multireturn, MLKNumber *x, MLKNumber *y, id _marker)
{
return [nullify(x) multiplyWith:nullify(y)];
}
static id
-divide (id *_data, MLKNumber *x, MLKNumber *y, id _marker)
+divide (id *_data, id *_multireturn, MLKNumber *x, MLKNumber *y, id _marker)
{
return [nullify(x) divideBy:nullify(y)];
}
static id
-add_fixnums (id *_data, id x, id y, id _marker)
+add_fixnums (id *_data, id *_multireturn, id x, id y, id _marker)
{
return MLKAddFixnums (x, y);
}
static id
-subtract_fixnums (id *_data, id x, id y, id _marker)
+subtract_fixnums (id *_data, id *_multireturn, id x, id y, id _marker)
{
return MLKSubtractFixnums (x, y);
}
static id
-idivide_fixnums (id *_data, id x, id y, id _marker)
+idivide_fixnums (id *_data, id *_multireturn, id x, id y, id _marker)
{
return MLKIDivideFixnums (x, y);
}
static id
-multiply_fixnums (id *_data, id x, id y, id _marker)
+multiply_fixnums (id *_data, id *_multireturn, id x, id y, id _marker)
{
return MLKMultiplyFixnums (x, y);
}
static id
-list (id *_data, ...)
+list (id *_data, id *_multireturn, ...)
{
id arg;
va_list ap;
@@ -282,7 +282,7 @@ list (id *_data, ...)
cons = nil;
tail = nil;
- va_start (ap, _data);
+ va_start (ap, _multireturn);
while ((arg = va_arg(ap, id)) != MLKEndOfArgumentsMarker)
{
@@ -308,7 +308,7 @@ list (id *_data, ...)
: (id)({ id __tmp = ARG; ARG = va_arg(AP, id); __tmp; }))
static id
-macroexpand_1 (id *_data, id form, id arg, ...)
+macroexpand_1 (id *_data, id *_multireturn, id form, id arg, ...)
{
va_list ap;
@@ -341,7 +341,7 @@ macroexpand_1 (id *_data, id form, id arg, ...)
}
static id
-shadow_ (id *_data, id symbols, id arg, ...)
+shadow_ (id *_data, id *_multireturn, id symbols, id arg, ...)
{
va_list ap;
@@ -365,7 +365,7 @@ shadow_ (id *_data, id symbols, id arg, ...)
}
static id
-export (id *_data, id symbols, id arg, ...)
+export (id *_data, id *_multireturn, id symbols, id arg, ...)
{
va_list ap;
@@ -389,7 +389,7 @@ export (id *_data, id symbols, id arg, ...)
}
static id
-unexport (id *_data, id symbols, id arg, ...)
+unexport (id *_data, id *_multireturn, id symbols, id arg, ...)
{
va_list ap;
@@ -413,7 +413,7 @@ unexport (id *_data, id symbols, id arg, ...)
}
static id
-find_package (id *_data, id name, id _marker)
+find_package (id *_data, id *_multireturn, id name, id _marker)
{
MLKPackage *package = [MLKPackage findPackage:stringify(name)];
@@ -431,13 +431,13 @@ find_package (id *_data, id name, id _marker)
}
static id
-string (id *_data, id x, id _marker)
+string (id *_data, id *_multireturn, id x, id _marker)
{
return stringify (x);
}
static id
-gensym (id *_data, id arg, ...)
+gensym (id *_data, id *_multireturn, id arg, ...)
{
va_list ap;
@@ -479,13 +479,13 @@ gensym (id *_data, id arg, ...)
}
static id
-make_symbol (id *_data, id name, id _marker)
+make_symbol (id *_data, id *_multireturn, id name, id _marker)
{
return [MLKSymbol symbolWithName:name package:nil];
}
static id
-intern (id *_data, id name, id arg, ...)
+intern (id *_data, id *_multireturn, id name, id arg, ...)
{
va_list ap;
@@ -500,7 +500,7 @@ intern (id *_data, id name, id arg, ...)
}
static id
-import (id *_data, id symbol, id arg, ...)
+import (id *_data, id *_multireturn, id symbol, id arg, ...)
{
va_list ap;
@@ -517,25 +517,25 @@ import (id *_data, id symbol, id arg, ...)
}
static id
-objc_class_of (id *_data, id x, id _marker)
+objc_class_of (id *_data, id *_multireturn, id x, id _marker)
{
return [x class];
}
static id
-objc_subclassp (id *_data, id x, id y, id _marker)
+objc_subclassp (id *_data, id *_multireturn, id x, id y, id _marker)
{
return truify ([x isSubclassOfClass:y]);
}
static id
-find_objc_class (id *_data, id x, id _marker)
+find_objc_class (id *_data, id *_multireturn, id x, id _marker)
{
return NSClassFromString (x);
}
static id
-ns_log (id *_data, id x, id _marker)
+ns_log (id *_data, id *_multireturn, id x, id _marker)
{
NSString *description = MLKPrintToString(x);
NSLog (@"%@", description);
@@ -543,13 +543,13 @@ ns_log (id *_data, id x, id _marker)
}
static id
-symbol_name (id *_data, id symbol, id _marker)
+symbol_name (id *_data, id *_multireturn, id symbol, id _marker)
{
return (symbol ? (id)[symbol name] : (id)@"NIL");
}
static id
-primitive_type_of (id *_data, id object, id _marker)
+primitive_type_of (id *_data, id *_multireturn, id object, id _marker)
{
if (!object)
{ return [cl intern:@"NULL"]; }
@@ -589,7 +589,7 @@ primitive_type_of (id *_data, id object, id _marker)
}
static id
-send_by_name (id *_data, id object, NSString *methodName, id arg, ...)
+send_by_name (id *_data, id *_multireturn, id object, NSString *methodName, id arg, ...)
{
NSInvocation *invocation;
SEL selector;
@@ -670,7 +670,7 @@ as provided by method %@ of object %@",
static id
-declarations_and_doc_and_forms (id *_data, id bodyAndDecls, id _marker)
+declarations_and_doc_and_forms (id *_data, id *_multireturn, id bodyAndDecls, id _marker)
{
id decls, doc, forms;
@@ -683,7 +683,7 @@ declarations_and_doc_and_forms (id *_data, id bodyAndDecls, id _marker)
static id
-declarations_and_forms (id *_data, id bodyAndDecls, id _marker)
+declarations_and_forms (id *_data, id *_multireturn, id bodyAndDecls, id _marker)
{
id decls, doc, forms;
@@ -694,7 +694,7 @@ declarations_and_forms (id *_data, id bodyAndDecls, id _marker)
}
static id
-compile (id *_data, id object, id _marker)
+compile (id *_data, id *_multireturn, id object, id _marker)
{
if (!MLKDefaultCompiler)
[NSException raise:@"MLKNotImplementedException"
@@ -709,7 +709,7 @@ compile (id *_data, id object, id _marker)
}
static id
-fset (id *_data, id symbol, id value, id _marker)
+fset (id *_data, id *_multireturn, id symbol, id value, id _marker)
{
[[MLKLexicalContext globalContext] addFunction:symbol];
[[MLKLexicalEnvironment globalEnvironment] addFunction:value
@@ -719,7 +719,7 @@ fset (id *_data, id symbol, id value, id _marker)
}
static id
-set (id *_data, id symbol, id value, id _marker)
+set (id *_data, id *_multireturn, id symbol, id value, id _marker)
{
MLKDynamicContext *dynamicContext = [MLKDynamicContext currentContext];
@@ -733,7 +733,7 @@ set (id *_data, id symbol, id value, id _marker)
}
static id
-macroset (id *_data, id symbol, id value, id _marker)
+macroset (id *_data, id *_multireturn, id symbol, id value, id _marker)
{
[[MLKLexicalContext globalContext] addMacro:value
forSymbol:symbol];
@@ -742,7 +742,7 @@ macroset (id *_data, id symbol, id value, id _marker)
}
static id
-apply (id *_data, id function, id arglist, id _marker)
+apply (id *_data, id *_multireturn, id function, id arglist, id _marker)
{
// FIXME: Multiple values.
@@ -760,7 +760,7 @@ apply (id *_data, id function, id arglist, id _marker)
}
static id
-eval (id *_data, id evaluand, id _marker)
+eval (id *_data, id *_multireturn, id evaluand, id _marker)
{
// FIXME: Multiple values.