From ac3c67818eaaf7e72e039bff93e4226f086b07e8 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 26 Jul 2008 14:48:12 +0200 Subject: Add OBJC-CLASS-OF, OBJC-SUBCLASSP, FIND-OBJC-CLASS, and NS-LOG. --- MLKPackage.m | 4 ++++ MLKRoot.m | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/MLKPackage.m b/MLKPackage.m index cae3416..039596a 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -115,6 +115,10 @@ static NSMutableDictionary *packages = nil; [sys export:[sys intern:@"MAKE-SYMBOL"]]; [sys export:[sys intern:@"IMPORT"]]; [sys export:[sys intern:@"INTERN"]]; + [sys export:[sys intern:@"OBJC-CLASS-OF"]]; + [sys export:[sys intern:@"OBJC-SUBCLASSP"]]; + [sys export:[sys intern:@"FIND-OBJC-CLASS"]]; + [sys export:[sys intern:@"NS-LOG"]]; [cl export:[cl intern:@"*BREAK-ON-SIGNALS*"]]; [cl export:[cl intern:@"*COMPILE-FILE-PATHNAME*"]]; diff --git a/MLKRoot.m b/MLKRoot.m index f6ee730..dc2560d 100644 --- a/MLKRoot.m +++ b/MLKRoot.m @@ -409,4 +409,27 @@ static id truify (BOOL value) RETURN_VALUE ([cl intern:@"T"]); } + ++(NSArray *) objc_class_of:(NSArray *)args +{ + RETURN_VALUE ([[args objectAtIndex:0] class]); +} + ++(NSArray *) objc_subclassp:(NSArray *)args +{ + RETURN_VALUE (truify ([[args objectAtIndex:0] isSubclassOfClass: + [args objectAtIndex:1]])); +} + ++(NSArray *) find_objc_class:(NSArray *)args +{ + RETURN_VALUE (NSClassFromString ([args objectAtIndex:0])); +} + ++(NSArray *) ns_log:(NSArray *)args +{ + NSString *description = [[args objectAtIndex:0] descriptionForLisp]; + NSLog (@"%@", description); + RETURN_VALUE ([args objectAtIndex:0]); +} @end -- cgit v1.2.3