summaryrefslogtreecommitdiff
path: root/MLKRoot.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-07-06 23:53:04 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-07-06 23:53:04 +0200
commit26a11662d6d371a1d0c44de6bb028a1523ba4dc5 (patch)
tree9532f796a01ba5b3000d3e5bd6062c59f2a934b6 /MLKRoot.m
parentbb79a71e7aa85536d3d60d50913d5fc39c4ac07b (diff)
Add class MLKNumber, unify arithmetic interface.
Diffstat (limited to 'MLKRoot.m')
-rw-r--r--MLKRoot.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/MLKRoot.m b/MLKRoot.m
index 4ba7ac7..cad22a4 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -19,6 +19,7 @@
#import "MLKCons.h"
#import "MLKDynamicContext.h"
#import "MLKInterpreter.h"
+#import "MLKNumber.h"
#import "MLKPackage.h"
#import "MLKRoot.h"
#import "MLKStream.h"
@@ -195,22 +196,22 @@ static id truify (BOOL value)
+(NSArray *) add:(NSArray *)args
{
- RETURN_VALUE ([[args objectAtIndex:0] add:[args objectAtIndex:1]]);
+ RETURN_VALUE ([((MLKNumber*)[args objectAtIndex:0]) add:[args objectAtIndex:1]]);
}
+(NSArray *) subtract:(NSArray *)args
{
- RETURN_VALUE ([[args objectAtIndex:0] subtract:[args objectAtIndex:1]]);
+ RETURN_VALUE ([((MLKNumber*)[args objectAtIndex:0]) subtract:[args objectAtIndex:1]]);
}
+(NSArray *) multiply:(NSArray *)args
{
- RETURN_VALUE ([[args objectAtIndex:0] multiplyWith:[args objectAtIndex:1]]);
+ RETURN_VALUE ([((MLKNumber*)[args objectAtIndex:0]) multiplyWith:[args objectAtIndex:1]]);
}
+(NSArray *) divide:(NSArray *)args
{
- RETURN_VALUE ([[args objectAtIndex:0] divideBy:[args objectAtIndex:1]]);
+ RETURN_VALUE ([((MLKNumber*)[args objectAtIndex:0]) divideBy:[args objectAtIndex:1]]);
}
+(NSArray *) list:(NSArray *)args