diff options
-rw-r--r-- | MLKPackage.m | 4 | ||||
-rw-r--r-- | MLKRoot.m | 14 | ||||
-rw-r--r-- | list-functions.lisp | 15 |
3 files changed, 24 insertions, 9 deletions
diff --git a/MLKPackage.m b/MLKPackage.m index 00d6344..cae3416 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -90,8 +90,8 @@ static NSMutableDictionary *packages = nil; [sys export:[sys intern:@"CAR"]]; [sys export:[sys intern:@"CDR"]]; - [sys export:[sys intern:@"SET-CAR"]]; - [sys export:[sys intern:@"SET-CDR"]]; + [sys export:[sys intern:@"RPLACA"]]; + [sys export:[sys intern:@"RPLACD"]]; [sys export:[sys intern:@"CONS"]]; [sys export:[sys intern:@"LOAD"]]; [sys export:[sys intern:@"EQ"]]; @@ -121,16 +121,18 @@ static id truify (BOOL value) return [NSArray arrayWithObject:nullify([denullify([args objectAtIndex:0]) cdr])]; } -+(NSArray *) set_car:(NSArray *)args ++(NSArray *) rplaca:(NSArray *)args { - [[args objectAtIndex:0] setCar:denullify([args objectAtIndex:1])]; - return [NSArray arrayWithObject:[args objectAtIndex:1]]; + MLKCons *cons = [args objectAtIndex:0]; + [cons setCar:denullify([args objectAtIndex:1])]; + RETURN_VALUE (cons); } -+(NSArray *) set_cdr:(NSArray *)args ++(NSArray *) rplacd:(NSArray *)args { - [[args objectAtIndex:0] setCdr:denullify([args objectAtIndex:1])]; - return [NSArray arrayWithObject:[args objectAtIndex:1]]; + MLKCons *cons = [args objectAtIndex:0]; + [cons setCdr:denullify([args objectAtIndex:1])]; + RETURN_VALUE (cons); } +(NSArray *) cons:(NSArray *)args diff --git a/list-functions.lisp b/list-functions.lisp index 9593118..464a9a4 100644 --- a/list-functions.lisp +++ b/list-functions.lisp @@ -164,5 +164,18 @@ ;;;;----------------------------------------------------------------- +;;;; ACCESSORS +;;;;----------------------------------------------------------------- +(shadow '(rplaca rplacd)) +(unexport '(sys::rplaca sys::rplacd) (find-package :sys)) + +(%defun rplaca args + (sys::rplaca (first args) (second args))) + +(%defun rplacd args + (sys::rplacd (first args) (second args))) + + +;;;;----------------------------------------------------------------- (export '(cons car cdr list* first second third fourth fifth sixth - seventh eigthth ninth tenth consp listp null)) + seventh eigthth ninth tenth consp listp null rplaca rplacd)) |