From 6adfde61994c1427dfbd3d1e0ccbee8f3f7e0365 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 28 Aug 2008 23:47:50 +0200 Subject: Make ToiletKit self-contained. --- GNUmakefile | 19 ++- MLKListenerController.m | 2 +- MLKPackage.m | 1 + MLKRoot.m | 12 +- Toilet Lisp.xcodeproj/project.pbxproj | 288 +--------------------------------- init.lisp | 56 +++---- 6 files changed, 66 insertions(+), 312 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 86b2711..b6f9a00 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -83,8 +83,23 @@ ToiletKit_OBJC_FILES = functions.m globals.m MLKArray.m \ NSString-MLKPrinting.m ToiletKit_OBJCFLAGS = -Wall ToiletKit_LDFLAGS = -lgmp -lffi -ldl -#LIBRARIES_DEPEND_UPON - +#FIXME: +ToiletKit_RESOURCE_FILES = array.lisp control-flow.lisp defun-0.lisp \ + defun-1.lisp destructuring-bind.lisp evaluation.lisp \ + ffi.lisp init.lisp list-functions-2.lisp \ + list-functions.lisp llvm-ffi.lisp numbers.lisp \ + package.lisp reader.lisp sharpsign.lisp string.lisp \ + types.lisp util.lisp \ + \ + Sacla/array.lisp Sacla/character.lisp Sacla/clos.lisp \ + Sacla/condition.lisp Sacla/cons.lisp Sacla/core.lisp \ + Sacla/data-and-control.lisp Sacla/do.lisp \ + Sacla/eval.lisp Sacla/hash-table.lisp Sacla/init.lisp \ + Sacla/loop.lisp Sacla/package.lisp Sacla/printer.lisp \ + Sacla/reader.lisp Sacla/sequence.lisp \ + Sacla/share-2.lisp Sacla/share.lisp Sacla/stand-in.lisp \ + Sacla/stream.lisp Sacla/string.lisp Sacla/symbol.lisp \ + Sacla/testbed.lisp ifeq ($(USE_LLVM),YES) LLVM_CONFIG = llvm-config diff --git a/MLKListenerController.m b/MLKListenerController.m index 680365f..2998ab2 100644 --- a/MLKListenerController.m +++ b/MLKListenerController.m @@ -35,7 +35,7 @@ - (void) initialiseInterpreter { - [inputField setStringValue:@"(load \"init.lisp\")"]; + [inputField setStringValue:@"(require \"init.lisp\")"]; [self submit:self]; } diff --git a/MLKPackage.m b/MLKPackage.m index d432465..193c83a 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -155,6 +155,7 @@ static NSMutableDictionary *packages = nil; [sys export:[sys intern:@"SET"]]; [sys export:[sys intern:@"APPLY"]]; [sys export:[sys intern:@"EVAL"]]; + [sys export:[sys intern:@"REQUIRE"]]; [sys export:[sys intern:@"OBJC-CLASS-OF"]]; [sys export:[sys intern:@"OBJC-SUBCLASSP"]]; diff --git a/MLKRoot.m b/MLKRoot.m index eaff94c..6789ffb 100644 --- a/MLKRoot.m +++ b/MLKRoot.m @@ -39,6 +39,7 @@ #import "util.h" #import +#import #import #import #import @@ -95,7 +96,6 @@ cons (id _data, id car, id cdr, id _marker) static id load (id _data, NSString *fileName, id _marker) { - // FIXME BOOL success; int l, i; NSInputStream *input = [NSInputStream inputStreamWithFileAtPath:fileName]; @@ -165,6 +165,15 @@ load (id _data, NSString *fileName, id _marker) return truify (success); } +static id +require (id _data, id moduleName, id _marker) +{ + NSBundle *toiletKit = [NSBundle bundleForClass:[MLKRoot class]]; + NSString *path = [[toiletKit resourcePath] + stringByAppendingPathComponent:stringify(moduleName)]; + return load (nil, path, MLKEndOfArgumentsMarker); +} + static id eq (id _data, id x, id y, id _marker) { @@ -808,6 +817,7 @@ register_sys (NSString *name, id (*function)()) register_sys (@"RPLACD", rplacd); register_sys (@"CONS", cons); register_sys (@"LOAD", load); + register_sys (@"REQUIRE", require); register_sys (@"EQ", eq); register_sys (@"FIXNUM-EQ", fixnum_eq); register_sys (@"SYMBOLP", symbolp); diff --git a/Toilet Lisp.xcodeproj/project.pbxproj b/Toilet Lisp.xcodeproj/project.pbxproj index c71a51a..2ec504f 100644 --- a/Toilet Lisp.xcodeproj/project.pbxproj +++ b/Toilet Lisp.xcodeproj/project.pbxproj @@ -15,42 +15,6 @@ A745C35A0E607D6F00C43A04 /* MLKLLVMCompiler.mm in Sources */ = {isa = PBXBuildFile; fileRef = A78713810E4EFF4000A7191F /* MLKLLVMCompiler.mm */; }; A745C4080E6189EB00C43A04 /* MLKReadEvalPrintLoop.m in Sources */ = {isa = PBXBuildFile; fileRef = A7E5C4850E21698100A01D81 /* MLKReadEvalPrintLoop.m */; }; A745C40A0E6189EB00C43A04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E5C55B0E21740C00A01D81 /* Foundation.framework */; }; - A745C40C0E6189EB00C43A04 /* control-flow.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834010E477B76005D64E0 /* control-flow.lisp */; }; - A745C40D0E6189EB00C43A04 /* defun-0.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834020E477B76005D64E0 /* defun-0.lisp */; }; - A745C40E0E6189EB00C43A04 /* defun-1.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834030E477B76005D64E0 /* defun-1.lisp */; }; - A745C40F0E6189EB00C43A04 /* destructuring-bind.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834040E477B76005D64E0 /* destructuring-bind.lisp */; }; - A745C4100E6189EB00C43A04 /* evaluation.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834050E477B76005D64E0 /* evaluation.lisp */; }; - A745C4110E6189EB00C43A04 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834060E477B76005D64E0 /* init.lisp */; }; - A745C4120E6189EB00C43A04 /* list-functions-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834070E477B76005D64E0 /* list-functions-2.lisp */; }; - A745C4130E6189EB00C43A04 /* list-functions.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834080E477B76005D64E0 /* list-functions.lisp */; }; - A745C4140E6189EB00C43A04 /* numbers.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834090E477B76005D64E0 /* numbers.lisp */; }; - A745C4150E6189EB00C43A04 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340A0E477B76005D64E0 /* reader.lisp */; }; - A745C4160E6189EB00C43A04 /* sharpsign.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340B0E477B76005D64E0 /* sharpsign.lisp */; }; - A745C4170E6189EB00C43A04 /* types.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340C0E477B76005D64E0 /* types.lisp */; }; - A745C4180E6189EB00C43A04 /* util.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340D0E477B76005D64E0 /* util.lisp */; }; - A745C41A0E6189EB00C43A04 /* array.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835670E477C26005D64E0 /* array.lisp */; }; - A745C41B0E6189EB00C43A04 /* character.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835680E477C26005D64E0 /* character.lisp */; }; - A745C41C0E6189EB00C43A04 /* clos.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835690E477C26005D64E0 /* clos.lisp */; }; - A745C41D0E6189EB00C43A04 /* condition.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356A0E477C26005D64E0 /* condition.lisp */; }; - A745C41E0E6189EB00C43A04 /* cons.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356B0E477C26005D64E0 /* cons.lisp */; }; - A745C41F0E6189EB00C43A04 /* core.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356C0E477C26005D64E0 /* core.lisp */; }; - A745C4200E6189EB00C43A04 /* data-and-control.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356D0E477C26005D64E0 /* data-and-control.lisp */; }; - A745C4210E6189EB00C43A04 /* do.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356E0E477C26005D64E0 /* do.lisp */; }; - A745C4220E6189EB00C43A04 /* eval.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356F0E477C26005D64E0 /* eval.lisp */; }; - A745C4230E6189EB00C43A04 /* hash-table.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835700E477C26005D64E0 /* hash-table.lisp */; }; - A745C4240E6189EB00C43A04 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835710E477C26005D64E0 /* init.lisp */; }; - A745C4250E6189EB00C43A04 /* loop.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835720E477C26005D64E0 /* loop.lisp */; }; - A745C4260E6189EB00C43A04 /* package.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835730E477C26005D64E0 /* package.lisp */; }; - A745C4270E6189EB00C43A04 /* printer.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835740E477C26005D64E0 /* printer.lisp */; }; - A745C4280E6189EB00C43A04 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835750E477C26005D64E0 /* reader.lisp */; }; - A745C4290E6189EB00C43A04 /* sequence.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835760E477C26005D64E0 /* sequence.lisp */; }; - A745C42A0E6189EB00C43A04 /* share-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835770E477C26005D64E0 /* share-2.lisp */; }; - A745C42B0E6189EB00C43A04 /* share.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835780E477C26005D64E0 /* share.lisp */; }; - A745C42C0E6189EB00C43A04 /* stand-in.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835790E477C26005D64E0 /* stand-in.lisp */; }; - A745C42D0E6189EB00C43A04 /* stream.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357A0E477C26005D64E0 /* stream.lisp */; }; - A745C42E0E6189EB00C43A04 /* string.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357B0E477C26005D64E0 /* string.lisp */; }; - A745C42F0E6189EB00C43A04 /* symbol.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357C0E477C26005D64E0 /* symbol.lisp */; }; - A745C4300E6189EB00C43A04 /* testbed.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357D0E477C26005D64E0 /* testbed.lisp */; }; A745C44E0E618B2C00C43A04 /* MLKLLVMCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = A78713850E4EFF5D00A7191F /* MLKLLVMCompiler.h */; }; A745C44F0E618B2C00C43A04 /* MLKLexicalContext-MLKLLVMCompilation.h in Headers */ = {isa = PBXBuildFile; fileRef = A72E9E6D0E5220B700BDE40F /* MLKLexicalContext-MLKLLVMCompilation.h */; }; A78711320E4C459200A7191F /* globals.m in Sources */ = {isa = PBXBuildFile; fileRef = A787112E0E4C459200A7191F /* globals.m */; }; @@ -114,42 +78,6 @@ A7A833950E476D0D005D64E0 /* MLKDispatchingMacroCharacterReader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8338F0E476D0D005D64E0 /* MLKDispatchingMacroCharacterReader.h */; }; A7A833960E476D0D005D64E0 /* MLKSharpsignColonReader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A833900E476D0D005D64E0 /* MLKSharpsignColonReader.h */; }; A7A833970E476D0D005D64E0 /* MLKValuesFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A833910E476D0D005D64E0 /* MLKValuesFunction.h */; }; - A7A8341B0E477B80005D64E0 /* control-flow.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834010E477B76005D64E0 /* control-flow.lisp */; }; - A7A8341C0E477B80005D64E0 /* defun-0.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834020E477B76005D64E0 /* defun-0.lisp */; }; - A7A8341D0E477B80005D64E0 /* defun-1.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834030E477B76005D64E0 /* defun-1.lisp */; }; - A7A8341E0E477B80005D64E0 /* destructuring-bind.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834040E477B76005D64E0 /* destructuring-bind.lisp */; }; - A7A8341F0E477B80005D64E0 /* evaluation.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834050E477B76005D64E0 /* evaluation.lisp */; }; - A7A834200E477B80005D64E0 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834060E477B76005D64E0 /* init.lisp */; }; - A7A834210E477B80005D64E0 /* list-functions-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834070E477B76005D64E0 /* list-functions-2.lisp */; }; - A7A834220E477B80005D64E0 /* list-functions.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834080E477B76005D64E0 /* list-functions.lisp */; }; - A7A834230E477B80005D64E0 /* numbers.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834090E477B76005D64E0 /* numbers.lisp */; }; - A7A834240E477B80005D64E0 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340A0E477B76005D64E0 /* reader.lisp */; }; - A7A834250E477B80005D64E0 /* sharpsign.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340B0E477B76005D64E0 /* sharpsign.lisp */; }; - A7A834260E477B80005D64E0 /* types.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340C0E477B76005D64E0 /* types.lisp */; }; - A7A834270E477B80005D64E0 /* util.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340D0E477B76005D64E0 /* util.lisp */; }; - A7A835E00E477C7F005D64E0 /* array.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835670E477C26005D64E0 /* array.lisp */; }; - A7A835E10E477C7F005D64E0 /* character.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835680E477C26005D64E0 /* character.lisp */; }; - A7A835E20E477C7F005D64E0 /* clos.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835690E477C26005D64E0 /* clos.lisp */; }; - A7A835E30E477C7F005D64E0 /* condition.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356A0E477C26005D64E0 /* condition.lisp */; }; - A7A835E40E477C7F005D64E0 /* cons.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356B0E477C26005D64E0 /* cons.lisp */; }; - A7A835E50E477C7F005D64E0 /* core.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356C0E477C26005D64E0 /* core.lisp */; }; - A7A835E60E477C7F005D64E0 /* data-and-control.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356D0E477C26005D64E0 /* data-and-control.lisp */; }; - A7A835E70E477C7F005D64E0 /* do.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356E0E477C26005D64E0 /* do.lisp */; }; - A7A835E80E477C7F005D64E0 /* eval.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356F0E477C26005D64E0 /* eval.lisp */; }; - A7A835E90E477C7F005D64E0 /* hash-table.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835700E477C26005D64E0 /* hash-table.lisp */; }; - A7A835EA0E477C7F005D64E0 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835710E477C26005D64E0 /* init.lisp */; }; - A7A835EB0E477C7F005D64E0 /* loop.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835720E477C26005D64E0 /* loop.lisp */; }; - A7A835EC0E477C7F005D64E0 /* package.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835730E477C26005D64E0 /* package.lisp */; }; - A7A835ED0E477C7F005D64E0 /* printer.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835740E477C26005D64E0 /* printer.lisp */; }; - A7A835EE0E477C7F005D64E0 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835750E477C26005D64E0 /* reader.lisp */; }; - A7A835EF0E477C7F005D64E0 /* sequence.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835760E477C26005D64E0 /* sequence.lisp */; }; - A7A835F00E477C7F005D64E0 /* share-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835770E477C26005D64E0 /* share-2.lisp */; }; - A7A835F10E477C7F005D64E0 /* share.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835780E477C26005D64E0 /* share.lisp */; }; - A7A835F20E477C7F005D64E0 /* stand-in.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835790E477C26005D64E0 /* stand-in.lisp */; }; - A7A835F30E477C7F005D64E0 /* stream.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357A0E477C26005D64E0 /* stream.lisp */; }; - A7A835F40E477C7F005D64E0 /* string.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357B0E477C26005D64E0 /* string.lisp */; }; - A7A835F50E477C7F005D64E0 /* symbol.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357C0E477C26005D64E0 /* symbol.lisp */; }; - A7A835F60E477C7F005D64E0 /* testbed.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357D0E477C26005D64E0 /* testbed.lisp */; }; A7A85D5B0E668CA700021916 /* ToiletLisp_main.m in Sources */ = {isa = PBXBuildFile; fileRef = A7A85D5A0E668CA700021916 /* ToiletLisp_main.m */; }; A7A85DDE0E668DEF00021916 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7E5C55B0E21740C00A01D81 /* Foundation.framework */; }; A7A85DE00E668E1500021916 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7A85DDF0E668E1500021916 /* AppKit.framework */; }; @@ -170,46 +98,7 @@ A7A8602D0E66FEFB00021916 /* MLKStreamStream.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A860230E66FEFB00021916 /* MLKStreamStream.h */; }; A7A8602E0E66FEFB00021916 /* MLKStreamStream.m in Sources */ = {isa = PBXBuildFile; fileRef = A7A860240E66FEFB00021916 /* MLKStreamStream.m */; }; A7A8603E0E6700D000021916 /* MLKToiletApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = A7A8603D0E6700D000021916 /* MLKToiletApplicationController.m */; }; - A7A860800E67058900021916 /* array.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A787112C0E4C456C00A7191F /* array.lisp */; }; - A7A860810E67058900021916 /* control-flow.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834010E477B76005D64E0 /* control-flow.lisp */; }; - A7A860820E67058900021916 /* defun-0.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834020E477B76005D64E0 /* defun-0.lisp */; }; - A7A860830E67058900021916 /* defun-1.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834030E477B76005D64E0 /* defun-1.lisp */; }; - A7A860840E67058900021916 /* destructuring-bind.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834040E477B76005D64E0 /* destructuring-bind.lisp */; }; - A7A860850E67058900021916 /* evaluation.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834050E477B76005D64E0 /* evaluation.lisp */; }; - A7A860860E67058900021916 /* ffi.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A787138B0E4EFF8A00A7191F /* ffi.lisp */; }; - A7A860870E67058900021916 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834060E477B76005D64E0 /* init.lisp */; }; - A7A860880E67058900021916 /* list-functions-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834070E477B76005D64E0 /* list-functions-2.lisp */; }; - A7A860890E67058900021916 /* list-functions.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834080E477B76005D64E0 /* list-functions.lisp */; }; - A7A8608A0E67058900021916 /* numbers.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A834090E477B76005D64E0 /* numbers.lisp */; }; - A7A8608B0E67058900021916 /* package.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A787138C0E4EFF8A00A7191F /* package.lisp */; }; - A7A8608C0E67058900021916 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340A0E477B76005D64E0 /* reader.lisp */; }; - A7A8608D0E67058900021916 /* sharpsign.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340B0E477B76005D64E0 /* sharpsign.lisp */; }; - A7A8608E0E67058900021916 /* string.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A787138D0E4EFF8A00A7191F /* string.lisp */; }; - A7A8608F0E67058900021916 /* types.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340C0E477B76005D64E0 /* types.lisp */; }; - A7A860900E67058900021916 /* util.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8340D0E477B76005D64E0 /* util.lisp */; }; - A7A860940E6705B300021916 /* array.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835670E477C26005D64E0 /* array.lisp */; }; - A7A860950E6705B300021916 /* character.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835680E477C26005D64E0 /* character.lisp */; }; - A7A860960E6705B300021916 /* clos.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835690E477C26005D64E0 /* clos.lisp */; }; - A7A860970E6705B300021916 /* condition.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356A0E477C26005D64E0 /* condition.lisp */; }; - A7A860980E6705B300021916 /* cons.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356B0E477C26005D64E0 /* cons.lisp */; }; - A7A860990E6705B300021916 /* core.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356C0E477C26005D64E0 /* core.lisp */; }; - A7A8609A0E6705B300021916 /* data-and-control.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356D0E477C26005D64E0 /* data-and-control.lisp */; }; - A7A8609B0E6705B300021916 /* do.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356E0E477C26005D64E0 /* do.lisp */; }; - A7A8609C0E6705B300021916 /* eval.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8356F0E477C26005D64E0 /* eval.lisp */; }; - A7A8609D0E6705B300021916 /* hash-table.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835700E477C26005D64E0 /* hash-table.lisp */; }; - A7A8609E0E6705B300021916 /* init.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835710E477C26005D64E0 /* init.lisp */; }; - A7A8609F0E6705B300021916 /* loop.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835720E477C26005D64E0 /* loop.lisp */; }; - A7A860A00E6705B300021916 /* package.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835730E477C26005D64E0 /* package.lisp */; }; - A7A860A10E6705B300021916 /* printer.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835740E477C26005D64E0 /* printer.lisp */; }; - A7A860A20E6705B300021916 /* reader.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835750E477C26005D64E0 /* reader.lisp */; }; - A7A860A30E6705B300021916 /* sequence.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835760E477C26005D64E0 /* sequence.lisp */; }; - A7A860A40E6705B300021916 /* share-2.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835770E477C26005D64E0 /* share-2.lisp */; }; - A7A860A50E6705B300021916 /* share.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835780E477C26005D64E0 /* share.lisp */; }; - A7A860A60E6705B300021916 /* stand-in.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A835790E477C26005D64E0 /* stand-in.lisp */; }; - A7A860A70E6705B300021916 /* stream.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357A0E477C26005D64E0 /* stream.lisp */; }; - A7A860A80E6705B300021916 /* string.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357B0E477C26005D64E0 /* string.lisp */; }; - A7A860A90E6705B300021916 /* symbol.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357C0E477C26005D64E0 /* symbol.lisp */; }; - A7A860AA0E6705B300021916 /* testbed.lisp in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7A8357D0E477C26005D64E0 /* testbed.lisp */; }; + A7A861490E67500500021916 /* ToiletKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A7E5C3EB0E21689F00A01D81 /* ToiletKit.framework */; }; A7B6D0C20E22094F006F6A21 /* MLKStringOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B6D0C00E22094F006F6A21 /* MLKStringOutputStream.h */; }; A7B6D0C30E22094F006F6A21 /* MLKStringOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = A7B6D0C10E22094F006F6A21 /* MLKStringOutputStream.m */; }; A7E5C43E0E21695800A01D81 /* MLKBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5C3F80E21695700A01D81 /* MLKBinding.h */; }; @@ -319,65 +208,11 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - A745C40B0E6189EB00C43A04 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - A745C40C0E6189EB00C43A04 /* control-flow.lisp in CopyFiles */, - A745C40D0E6189EB00C43A04 /* defun-0.lisp in CopyFiles */, - A745C40E0E6189EB00C43A04 /* defun-1.lisp in CopyFiles */, - A745C40F0E6189EB00C43A04 /* destructuring-bind.lisp in CopyFiles */, - A745C4100E6189EB00C43A04 /* evaluation.lisp in CopyFiles */, - A745C4110E6189EB00C43A04 /* init.lisp in CopyFiles */, - A745C4120E6189EB00C43A04 /* list-functions-2.lisp in CopyFiles */, - A745C4130E6189EB00C43A04 /* list-functions.lisp in CopyFiles */, - A745C4140E6189EB00C43A04 /* numbers.lisp in CopyFiles */, - A745C4150E6189EB00C43A04 /* reader.lisp in CopyFiles */, - A745C4160E6189EB00C43A04 /* sharpsign.lisp in CopyFiles */, - A745C4170E6189EB00C43A04 /* types.lisp in CopyFiles */, - A745C4180E6189EB00C43A04 /* util.lisp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A745C4190E6189EB00C43A04 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = Sacla; - dstSubfolderSpec = 16; - files = ( - A745C41A0E6189EB00C43A04 /* array.lisp in CopyFiles */, - A745C41B0E6189EB00C43A04 /* character.lisp in CopyFiles */, - A745C41C0E6189EB00C43A04 /* clos.lisp in CopyFiles */, - A745C41D0E6189EB00C43A04 /* condition.lisp in CopyFiles */, - A745C41E0E6189EB00C43A04 /* cons.lisp in CopyFiles */, - A745C41F0E6189EB00C43A04 /* core.lisp in CopyFiles */, - A745C4200E6189EB00C43A04 /* data-and-control.lisp in CopyFiles */, - A745C4210E6189EB00C43A04 /* do.lisp in CopyFiles */, - A745C4220E6189EB00C43A04 /* eval.lisp in CopyFiles */, - A745C4230E6189EB00C43A04 /* hash-table.lisp in CopyFiles */, - A745C4240E6189EB00C43A04 /* init.lisp in CopyFiles */, - A745C4250E6189EB00C43A04 /* loop.lisp in CopyFiles */, - A745C4260E6189EB00C43A04 /* package.lisp in CopyFiles */, - A745C4270E6189EB00C43A04 /* printer.lisp in CopyFiles */, - A745C4280E6189EB00C43A04 /* reader.lisp in CopyFiles */, - A745C4290E6189EB00C43A04 /* sequence.lisp in CopyFiles */, - A745C42A0E6189EB00C43A04 /* share-2.lisp in CopyFiles */, - A745C42B0E6189EB00C43A04 /* share.lisp in CopyFiles */, - A745C42C0E6189EB00C43A04 /* stand-in.lisp in CopyFiles */, - A745C42D0E6189EB00C43A04 /* stream.lisp in CopyFiles */, - A745C42E0E6189EB00C43A04 /* string.lisp in CopyFiles */, - A745C42F0E6189EB00C43A04 /* symbol.lisp in CopyFiles */, - A745C4300E6189EB00C43A04 /* testbed.lisp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; A787116F0E4C4A0200A7191F /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; - dstSubfolderSpec = 16; + dstSubfolderSpec = 7; files = ( A78712010E4C4AC500A7191F /* array.lisp in CopyFiles */, A78712020E4C4AC500A7191F /* control-flow.lisp in CopyFiles */, @@ -403,7 +238,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = Sacla; - dstSubfolderSpec = 16; + dstSubfolderSpec = 7; files = ( A787120F0E4C4ADE00A7191F /* array.lisp in CopyFiles */, A78712100E4C4ADE00A7191F /* character.lisp in CopyFiles */, @@ -431,115 +266,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - A7A833FD0E477B33005D64E0 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - A7A8341B0E477B80005D64E0 /* control-flow.lisp in CopyFiles */, - A7A8341C0E477B80005D64E0 /* defun-0.lisp in CopyFiles */, - A7A8341D0E477B80005D64E0 /* defun-1.lisp in CopyFiles */, - A7A8341E0E477B80005D64E0 /* destructuring-bind.lisp in CopyFiles */, - A7A8341F0E477B80005D64E0 /* evaluation.lisp in CopyFiles */, - A7A834200E477B80005D64E0 /* init.lisp in CopyFiles */, - A7A834210E477B80005D64E0 /* list-functions-2.lisp in CopyFiles */, - A7A834220E477B80005D64E0 /* list-functions.lisp in CopyFiles */, - A7A834230E477B80005D64E0 /* numbers.lisp in CopyFiles */, - A7A834240E477B80005D64E0 /* reader.lisp in CopyFiles */, - A7A834250E477B80005D64E0 /* sharpsign.lisp in CopyFiles */, - A7A834260E477B80005D64E0 /* types.lisp in CopyFiles */, - A7A834270E477B80005D64E0 /* util.lisp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7A835DE0E477C67005D64E0 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = Sacla; - dstSubfolderSpec = 16; - files = ( - A7A835E00E477C7F005D64E0 /* array.lisp in CopyFiles */, - A7A835E10E477C7F005D64E0 /* character.lisp in CopyFiles */, - A7A835E20E477C7F005D64E0 /* clos.lisp in CopyFiles */, - A7A835E30E477C7F005D64E0 /* condition.lisp in CopyFiles */, - A7A835E40E477C7F005D64E0 /* cons.lisp in CopyFiles */, - A7A835E50E477C7F005D64E0 /* core.lisp in CopyFiles */, - A7A835E60E477C7F005D64E0 /* data-and-control.lisp in CopyFiles */, - A7A835E70E477C7F005D64E0 /* do.lisp in CopyFiles */, - A7A835E80E477C7F005D64E0 /* eval.lisp in CopyFiles */, - A7A835E90E477C7F005D64E0 /* hash-table.lisp in CopyFiles */, - A7A835EA0E477C7F005D64E0 /* init.lisp in CopyFiles */, - A7A835EB0E477C7F005D64E0 /* loop.lisp in CopyFiles */, - A7A835EC0E477C7F005D64E0 /* package.lisp in CopyFiles */, - A7A835ED0E477C7F005D64E0 /* printer.lisp in CopyFiles */, - A7A835EE0E477C7F005D64E0 /* reader.lisp in CopyFiles */, - A7A835EF0E477C7F005D64E0 /* sequence.lisp in CopyFiles */, - A7A835F00E477C7F005D64E0 /* share-2.lisp in CopyFiles */, - A7A835F10E477C7F005D64E0 /* share.lisp in CopyFiles */, - A7A835F20E477C7F005D64E0 /* stand-in.lisp in CopyFiles */, - A7A835F30E477C7F005D64E0 /* stream.lisp in CopyFiles */, - A7A835F40E477C7F005D64E0 /* string.lisp in CopyFiles */, - A7A835F50E477C7F005D64E0 /* symbol.lisp in CopyFiles */, - A7A835F60E477C7F005D64E0 /* testbed.lisp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7A8607E0E67051B00021916 /* CopyFiles */ = { + A7A861410E674FE100021916 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; - dstSubfolderSpec = 6; + dstSubfolderSpec = 10; files = ( - A7A860800E67058900021916 /* array.lisp in CopyFiles */, - A7A860810E67058900021916 /* control-flow.lisp in CopyFiles */, - A7A860820E67058900021916 /* defun-0.lisp in CopyFiles */, - A7A860830E67058900021916 /* defun-1.lisp in CopyFiles */, - A7A860840E67058900021916 /* destructuring-bind.lisp in CopyFiles */, - A7A860850E67058900021916 /* evaluation.lisp in CopyFiles */, - A7A860860E67058900021916 /* ffi.lisp in CopyFiles */, - A7A860870E67058900021916 /* init.lisp in CopyFiles */, - A7A860880E67058900021916 /* list-functions-2.lisp in CopyFiles */, - A7A860890E67058900021916 /* list-functions.lisp in CopyFiles */, - A7A8608A0E67058900021916 /* numbers.lisp in CopyFiles */, - A7A8608B0E67058900021916 /* package.lisp in CopyFiles */, - A7A8608C0E67058900021916 /* reader.lisp in CopyFiles */, - A7A8608D0E67058900021916 /* sharpsign.lisp in CopyFiles */, - A7A8608E0E67058900021916 /* string.lisp in CopyFiles */, - A7A8608F0E67058900021916 /* types.lisp in CopyFiles */, - A7A860900E67058900021916 /* util.lisp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7A860920E67059900021916 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = Sacla; - dstSubfolderSpec = 6; - files = ( - A7A860940E6705B300021916 /* array.lisp in CopyFiles */, - A7A860950E6705B300021916 /* character.lisp in CopyFiles */, - A7A860960E6705B300021916 /* clos.lisp in CopyFiles */, - A7A860970E6705B300021916 /* condition.lisp in CopyFiles */, - A7A860980E6705B300021916 /* cons.lisp in CopyFiles */, - A7A860990E6705B300021916 /* core.lisp in CopyFiles */, - A7A8609A0E6705B300021916 /* data-and-control.lisp in CopyFiles */, - A7A8609B0E6705B300021916 /* do.lisp in CopyFiles */, - A7A8609C0E6705B300021916 /* eval.lisp in CopyFiles */, - A7A8609D0E6705B300021916 /* hash-table.lisp in CopyFiles */, - A7A8609E0E6705B300021916 /* init.lisp in CopyFiles */, - A7A8609F0E6705B300021916 /* loop.lisp in CopyFiles */, - A7A860A00E6705B300021916 /* package.lisp in CopyFiles */, - A7A860A10E6705B300021916 /* printer.lisp in CopyFiles */, - A7A860A20E6705B300021916 /* reader.lisp in CopyFiles */, - A7A860A30E6705B300021916 /* sequence.lisp in CopyFiles */, - A7A860A40E6705B300021916 /* share-2.lisp in CopyFiles */, - A7A860A50E6705B300021916 /* share.lisp in CopyFiles */, - A7A860A60E6705B300021916 /* stand-in.lisp in CopyFiles */, - A7A860A70E6705B300021916 /* stream.lisp in CopyFiles */, - A7A860A80E6705B300021916 /* string.lisp in CopyFiles */, - A7A860A90E6705B300021916 /* symbol.lisp in CopyFiles */, - A7A860AA0E6705B300021916 /* testbed.lisp in CopyFiles */, + A7A861490E67500500021916 /* ToiletKit.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1064,8 +797,7 @@ A72BC6EA0E65DE4600486804 /* Resources */, A72BC6EB0E65DE4600486804 /* Sources */, A72BC6EC0E65DE4600486804 /* Frameworks */, - A7A8607E0E67051B00021916 /* CopyFiles */, - A7A860920E67059900021916 /* CopyFiles */, + A7A861410E674FE100021916 /* CopyFiles */, ); buildRules = ( ); @@ -1101,8 +833,6 @@ buildPhases = ( A745C4070E6189EB00C43A04 /* Sources */, A745C4090E6189EB00C43A04 /* Frameworks */, - A745C40B0E6189EB00C43A04 /* CopyFiles */, - A745C4190E6189EB00C43A04 /* CopyFiles */, ); buildRules = ( ); @@ -1139,8 +869,6 @@ buildPhases = ( A7E5C3F00E21690200A01D81 /* Sources */, A7E5C3F10E21690200A01D81 /* Frameworks */, - A7A833FD0E477B33005D64E0 /* CopyFiles */, - A7A835DE0E477C67005D64E0 /* CopyFiles */, ); buildRules = ( ); @@ -2504,7 +2232,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; HEADER_SEARCH_PATHS = /opt/local/include; INFOPLIST_FILE = "ToiletKit-Info.plist"; - INSTALL_PATH = "$(HOME)/Library/Frameworks"; + INSTALL_PATH = /Library/Frameworks; LIBRARY_SEARCH_PATHS = /opt/local/lib; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_CFLAGS = "-DHAVE_FFI_H"; diff --git a/init.lisp b/init.lisp index 71a4211..87ac802 100644 --- a/init.lisp +++ b/init.lisp @@ -18,34 +18,34 @@ (in-package #:common-lisp) -(load "util.lisp") -(load "defun-0.lisp") -(load "list-functions.lisp") -(load "destructuring-bind.lisp") -(load "defun-1.lisp") -(load "list-functions.lisp") -(load "reader.lisp") -(load "sharpsign.lisp") -(load "control-flow.lisp") -(load "types.lisp") -(load "numbers.lisp") -(load "list-functions-2.lisp") -(load "ffi.lisp") - -(load "Sacla/share.lisp") -(load "Sacla/do.lisp") - -(load "evaluation.lisp") - -(load "Sacla/share-2.lisp") - -(load "Sacla/data-and-control.lisp") - -(load "array.lisp") -(load "Sacla/array.lisp") - -(load "string.lisp") -(load "package.lisp") +(require "util.lisp") +(require "defun-0.lisp") +(require "list-functions.lisp") +(require "destructuring-bind.lisp") +(require "defun-1.lisp") +(require "list-functions.lisp") +(require "reader.lisp") +(require "sharpsign.lisp") +(require "control-flow.lisp") +(require "types.lisp") +(require "numbers.lisp") +(require "list-functions-2.lisp") +(require "ffi.lisp") + +(require "Sacla/share.lisp") +(require "Sacla/do.lisp") + +(require "evaluation.lisp") + +(require "Sacla/share-2.lisp") + +(require "Sacla/data-and-control.lisp") + +(require "array.lisp") +(require "Sacla/array.lisp") + +(require "string.lisp") +(require "package.lisp") (setq *system-initialised-p* t) -- cgit v1.2.3 From e7095370d02ba8608c4918c199d6647e10e4378e Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Fri, 29 Aug 2008 11:29:43 +0200 Subject: MLKCons: Add HeaderDoc comments. --- MLKCons.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/MLKCons.h b/MLKCons.h index 84d3c56..4b2ad6a 100644 --- a/MLKCons.h +++ b/MLKCons.h @@ -19,22 +19,66 @@ #import +/*! @class MLKCons + +@abstract A cons cell. + +@discussion A cons cell (or simply: a cons) is an ordered pair whose first +element is called the car and whose second element is called the cdr of the cons. +Cons cells are mutable by default. + +Note that nil is explicitely allowed as both the car and cdr of a cons cell. In fact, +when representing linked lists using cons cells, nil in the cdr of the last cons cell +is what conventionally marks the end of a list. +*/ @interface MLKCons : NSObject { id _car; id _cdr; } +/*! @method cons:with: + +@abstract Cons two objects together. + +@param car The car of the new cons cell. +@param cdr The cdr of the new cons cell. +@return A newly allocated cons. +*/ +(MLKCons*) cons:(id)car with:(id)cdr; + + +/*! @method listWithArray: +@abstract Make a linked list of cons cells out of an array. */ +(MLKCons*) listWithArray:(NSArray *)array; +/*! @method initWithCar:cdr: +@abstract Initialise a new cons cell with car and cdr. +*/ -(MLKCons*) initWithCar:(id)car cdr:(id)cdr; +/*! @method car +@abstract The car of the cons cell. +*/ -(id) car; + +/*! @method cdr +@abstract The cdr of the cons cell. +*/ -(id) cdr; + +/*! @method setCar: +@abstract Change the car of the cons cell. +*/ -(void) setCar:(id)value; + +/*! @method setCdr: +@abstract Change the cdr of the cons cell. +*/ -(void) setCdr:(id)value; +/*! @method array +@abstract Return the content of the linked list represented by this cons cell as an array. */ -(NSArray *) array; -(void) appendObject:(id)object; -- cgit v1.2.3 From 6db2297be23390eb580e4632e9968dab80a22ea6 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 29 Aug 2008 16:20:26 +0200 Subject: MLKCons: Convert documentation to Natural Docs format. --- MLKCons.h | 66 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/MLKCons.h b/MLKCons.h index 4b2ad6a..79712cb 100644 --- a/MLKCons.h +++ b/MLKCons.h @@ -19,17 +19,18 @@ #import -/*! @class MLKCons +/* Class: MLKCons -@abstract A cons cell. + A cons cell. -@discussion A cons cell (or simply: a cons) is an ordered pair whose first -element is called the car and whose second element is called the cdr of the cons. -Cons cells are mutable by default. + A cons cell (or simply: a cons) is an ordered pair whose first + element is called the car and whose second element is called the cdr + of the cons. Cons cells are mutable by default. -Note that nil is explicitely allowed as both the car and cdr of a cons cell. In fact, -when representing linked lists using cons cells, nil in the cdr of the last cons cell -is what conventionally marks the end of a list. + Note that nil is explicitely allowed as both the car and cdr of a + cons cell. In fact, when representing linked lists using cons cells, + nil in the cdr of the last cons cell is what conventionally marks the + end of a list. */ @interface MLKCons : NSObject { @@ -37,48 +38,59 @@ is what conventionally marks the end of a list. id _cdr; } -/*! @method cons:with: +/* Method: +cons:with: -@abstract Cons two objects together. + Cons two objects together. -@param car The car of the new cons cell. -@param cdr The cdr of the new cons cell. -@return A newly allocated cons. + Arguments: + + car - The car of the new cons cell. + cdr - The cdr of the new cons cell. + + Returns: A newly allocated cons. */ +(MLKCons*) cons:(id)car with:(id)cdr; -/*! @method listWithArray: -@abstract Make a linked list of cons cells out of an array. */ +/* Method: +listWithArray: + + Make a linked list of cons cells out of an array. */ +(MLKCons*) listWithArray:(NSArray *)array; -/*! @method initWithCar:cdr: -@abstract Initialise a new cons cell with car and cdr. +/* Method: -initWithCar:cdr: + + Initialise a new cons cell with car and cdr. */ -(MLKCons*) initWithCar:(id)car cdr:(id)cdr; -/*! @method car -@abstract The car of the cons cell. +/* Method: -car + + The car of the cons cell. */ -(id) car; -/*! @method cdr -@abstract The cdr of the cons cell. +/* Method: -cdr + + The cdr of the cons cell. */ -(id) cdr; -/*! @method setCar: -@abstract Change the car of the cons cell. +/* Method: -setCar: + + Change the car of the cons cell. */ -(void) setCar:(id)value; -/*! @method setCdr: -@abstract Change the cdr of the cons cell. +/* Method: setCdr: + + Change the cdr of the cons cell. */ -(void) setCdr:(id)value; -/*! @method array -@abstract Return the content of the linked list represented by this cons cell as an array. */ +/* Method: -array + + Return the content of the linked list represented by this cons cell as an array. +*/ -(NSArray *) array; -(void) appendObject:(id)object; -- cgit v1.2.3 From b7dd2dfe91dd1f6ef9b0a4fed64360c816f0b1b2 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 29 Aug 2008 16:26:18 +0200 Subject: Add Natural Docs configuration. --- NaturalDocs/Languages.txt | 127 ++++++++++++++++++++++++++++++++++++++++++++++ NaturalDocs/Menu.txt | 58 +++++++++++++++++++++ NaturalDocs/ObjC.pm | 93 +++++++++++++++++++++++++++++++++ NaturalDocs/Topics.txt | 81 +++++++++++++++++++++++++++++ 4 files changed, 359 insertions(+) create mode 100644 NaturalDocs/Languages.txt create mode 100644 NaturalDocs/Menu.txt create mode 100755 NaturalDocs/ObjC.pm create mode 100644 NaturalDocs/Topics.txt diff --git a/NaturalDocs/Languages.txt b/NaturalDocs/Languages.txt new file mode 100644 index 0000000..d34f7e9 --- /dev/null +++ b/NaturalDocs/Languages.txt @@ -0,0 +1,127 @@ +Format: Development Release 12-07-2007 (1.35 base) + +# This is the Natural Docs languages file for this project. If you change +# anything here, it will apply to THIS PROJECT ONLY. If you'd like to change +# something for all your projects, edit the Languages.txt in Natural Docs' +# Config directory instead. + + +# You can prevent certain file extensions from being scanned like this: +# Ignore Extensions: [extension] [extension] ... + + +#------------------------------------------------------------------------------- +# SYNTAX: +# +# Unlike other Natural Docs configuration files, in this file all comments +# MUST be alone on a line. Some languages deal with the # character, so you +# cannot put comments on the same line as content. +# +# Also, all lists are separated with spaces, not commas, again because some +# languages may need to use them. +# +# Language: [name] +# Alter Language: [name] +# Defines a new language or alters an existing one. Its name can use any +# characters. If any of the properties below have an add/replace form, you +# must use that when using Alter Language. +# +# The language Shebang Script is special. It's entry is only used for +# extensions, and files with those extensions have their shebang (#!) lines +# read to determine the real language of the file. Extensionless files are +# always treated this way. +# +# The language Text File is also special. It's treated as one big comment +# so you can put Natural Docs content in them without special symbols. Also, +# if you don't specify a package separator, ignored prefixes, or enum value +# behavior, it will copy those settings from the language that is used most +# in the source tree. +# +# Extensions: [extension] [extension] ... +# [Add/Replace] Extensions: [extension] [extension] ... +# Defines the file extensions of the language's source files. You can +# redefine extensions found in the main languages file. You can use * to +# mean any undefined extension. +# +# Shebang Strings: [string] [string] ... +# [Add/Replace] Shebang Strings: [string] [string] ... +# Defines a list of strings that can appear in the shebang (#!) line to +# designate that it's part of the language. You can redefine strings found +# in the main languages file. +# +# Ignore Prefixes in Index: [prefix] [prefix] ... +# [Add/Replace] Ignored Prefixes in Index: [prefix] [prefix] ... +# +# Ignore [Topic Type] Prefixes in Index: [prefix] [prefix] ... +# [Add/Replace] Ignored [Topic Type] Prefixes in Index: [prefix] [prefix] ... +# Specifies prefixes that should be ignored when sorting symbols in an +# index. Can be specified in general or for a specific topic type. +# +#------------------------------------------------------------------------------ +# For basic language support only: +# +# Line Comments: [symbol] [symbol] ... +# Defines a space-separated list of symbols that are used for line comments, +# if any. +# +# Block Comments: [opening sym] [closing sym] [opening sym] [closing sym] ... +# Defines a space-separated list of symbol pairs that are used for block +# comments, if any. +# +# Package Separator: [symbol] +# Defines the default package separator symbol. The default is a dot. +# +# [Topic Type] Prototype Enders: [symbol] [symbol] ... +# When defined, Natural Docs will attempt to get a prototype from the code +# immediately following the topic type. It stops when it reaches one of +# these symbols. Use \n for line breaks. +# +# Line Extender: [symbol] +# Defines the symbol that allows a prototype to span multiple lines if +# normally a line break would end it. +# +# Enum Values: [global|under type|under parent] +# Defines how enum values are referenced. The default is global. +# global - Values are always global, referenced as 'value'. +# under type - Values are under the enum type, referenced as +# 'package.enum.value'. +# under parent - Values are under the enum's parent, referenced as +# 'package.value'. +# +# Perl Package: [perl package] +# Specifies the Perl package used to fine-tune the language behavior in ways +# too complex to do in this file. +# +#------------------------------------------------------------------------------ +# For full language support only: +# +# Full Language Support: [perl package] +# Specifies the Perl package that has the parsing routines necessary for full +# language support. +# +#------------------------------------------------------------------------------- + +# The following languages are defined in the main file, if you'd like to alter +# them: +# +# Text File, Shebang Script, C/C++, C#, Java, JavaScript, Perl, Python, +# PHP, SQL, Visual Basic, Pascal, Assembly, Ada, Tcl, Ruby, Makefile, +# ActionScript, ColdFusion, R, Fortran + +# If you add a language that you think would be useful to other developers +# and should be included in Natural Docs by default, please e-mail it to +# languages [at] naturaldocs [dot] org. + + +Language: Objective-C + + Extensions: m mm h + Shebang String: objc + Ignore Prefix in Index: MLK + Line Comment: // + Block Comment: /* */ + Package Separator: :: + Class Prototype Enders: + - @end + Function Prototype Enders: ; { + Variable Prototype Enders: ; = + Perl Package: NaturalDocs::Languages::ObjC diff --git a/NaturalDocs/Menu.txt b/NaturalDocs/Menu.txt new file mode 100644 index 0000000..401bcee --- /dev/null +++ b/NaturalDocs/Menu.txt @@ -0,0 +1,58 @@ +Format: Development Release 12-07-2007 (1.35 base) + + +# You can add a title and sub-title to your menu like this: +# Title: [project name] +# SubTitle: [subtitle] + +# You can add a footer to your documentation like this: +# Footer: [text] +# If you want to add a copyright notice, this would be the place to do it. + +# You can add a timestamp to your documentation like one of these: +# Timestamp: Generated on month day, year +# Timestamp: Updated mm/dd/yyyy +# Timestamp: Last updated mon day +# +# m - One or two digit month. January is "1" +# mm - Always two digit month. January is "01" +# mon - Short month word. January is "Jan" +# month - Long month word. January is "January" +# d - One or two digit day. 1 is "1" +# dd - Always two digit day. 1 is "01" +# day - Day with letter extension. 1 is "1st" +# yy - Two digit year. 2006 is "06" +# yyyy - Four digit year. 2006 is "2006" +# year - Four digit year. 2006 is "2006" + + +# -------------------------------------------------------------------------- +# +# Cut and paste the lines below to change the order in which your files +# appear on the menu. Don't worry about adding or removing files, Natural +# Docs will take care of that. +# +# You can further organize the menu by grouping the entries. Add a +# "Group: [name] {" line to start a group, and add a "}" to end it. +# +# You can add text and web links to the menu by adding "Text: [text]" and +# "Link: [name] ([URL])" lines, respectively. +# +# The formatting and comments are auto-generated, so don't worry about +# neatness when editing the file. Natural Docs will clean it up the next +# time it is run. When working with groups, just deal with the braces and +# forget about the indentation and comments. +# +# -------------------------------------------------------------------------- + + +File: MLKCons (MLKCons.h) +File: Need to take *PRINT-GENSYM* into account. (MLKSymbol.m) + +Group: Index { + + Index: Everything + Class Index: Classes + Function Index: Functions + } # Group: Index + diff --git a/NaturalDocs/ObjC.pm b/NaturalDocs/ObjC.pm new file mode 100755 index 0000000..2c78478 --- /dev/null +++ b/NaturalDocs/ObjC.pm @@ -0,0 +1,93 @@ +############################################################################### +# +# Class: NaturalDocs::Languages::ObjC +# +############################################################################### +# +# Handle Objective-C. +# +############################################################################### + +use strict; +use integer; + +package NaturalDocs::Languages::ObjC; + +use base 'NaturalDocs::Languages::Simple'; +use NaturalDocs::Languages; + +sub OnCode +{ + my ($self, $codeLines, $codeLineNumber, $topicList, $lastCommentTopicCount) = @_; + $self->SUPER::OnCode ($codeLines, $codeLineNumber, $topicList, $lastCommentTopicCount); + + my $topic = $topicList->[-1]; + my $line = $codeLines->[0]; + if ($lastCommentTopicCount) + { + #print "$topic\n"; + #print "$line\n"; + unless ($topic->Prototype()) + { + my $code = join ("\n", @{$codeLines}); + if ($topic->Type() eq ::TOPIC_FUNCTION()) + { + if ($code =~ /\s*([-+].*)[;{]/) + { + $topic->SetPrototype($1); + } + } + elsif ($topic->Type() eq ::TOPIC_CLASS()) + { + if ($code =~ /\s*(\@interface.*\n)/) + { + $topic->SetPrototype($1); + } + } + } + } +}; + +sub ParsePrototype +{ + my ($self, $topic_type, $prototype) = @_; + + #print "$prototype\n"; + + $_ = $prototype; + if ($topic_type == ::TOPIC_FUNCTION and /([-+]\s*\((.*?)\)\s*)(.*)/) + { + my $return_type = $2; + my $p = NaturalDocs::Languages::Prototype->New ($1, ""); + my $args_p = 0; + + $_ = $3; + while (/(\S+)\((.*?)\)\s*(\S+)(?:(\s+(.*))?|$)/) + { + #print "$4, $1, $2, $3\n"; + $p->AddParameter (NaturalDocs::Languages::Prototype::Parameter->New ("($2)", + $1, + $3, + "", + "", + "")); + $args_p = 1; + $_ = $4; + } + + if ($args_p) + { + return $p; + } + else + { + return NaturalDocs::Languages::Prototype->New ($prototype, ""); + } + } + else + { + return $self->SUPER::ParsePrototype ($topic_type, $prototype); + } +}; + +1; diff --git a/NaturalDocs/Topics.txt b/NaturalDocs/Topics.txt new file mode 100644 index 0000000..caaa009 --- /dev/null +++ b/NaturalDocs/Topics.txt @@ -0,0 +1,81 @@ +Format: Development Release 12-07-2007 (1.35 base) + +# This is the Natural Docs topics file for this project. If you change anything +# here, it will apply to THIS PROJECT ONLY. If you'd like to change something +# for all your projects, edit the Topics.txt in Natural Docs' Config directory +# instead. + + +# If you'd like to prevent keywords from being recognized by Natural Docs, you +# can do it like this: +# Ignore Keywords: [keyword], [keyword], ... +# +# Or you can use the list syntax like how they are defined: +# Ignore Keywords: +# [keyword] +# [keyword], [plural keyword] +# ... + + +#------------------------------------------------------------------------------- +# SYNTAX: +# +# Topic Type: [name] +# Alter Topic Type: [name] +# Creates a new topic type or alters one from the main file. Each type gets +# its own index and behavior settings. Its name can have letters, numbers, +# spaces, and these charaters: - / . ' +# +# Plural: [name] +# Sets the plural name of the topic type, if different. +# +# Keywords: +# [keyword] +# [keyword], [plural keyword] +# ... +# Defines or adds to the list of keywords for the topic type. They may only +# contain letters, numbers, and spaces and are not case sensitive. Plural +# keywords are used for list topics. You can redefine keywords found in the +# main topics file. +# +# Index: [yes|no] +# Whether the topics get their own index. Defaults to yes. Everything is +# included in the general index regardless of this setting. +# +# Scope: [normal|start|end|always global] +# How the topics affects scope. Defaults to normal. +# normal - Topics stay within the current scope. +# start - Topics start a new scope for all the topics beneath it, +# like class topics. +# end - Topics reset the scope back to global for all the topics +# beneath it. +# always global - Topics are defined as global, but do not change the scope +# for any other topics. +# +# Class Hierarchy: [yes|no] +# Whether the topics are part of the class hierarchy. Defaults to no. +# +# Page Title If First: [yes|no] +# Whether the topic's title becomes the page title if it's the first one in +# a file. Defaults to no. +# +# Break Lists: [yes|no] +# Whether list topics should be broken into individual topics in the output. +# Defaults to no. +# +# Can Group With: [type], [type], ... +# Defines a list of topic types that this one can possibly be grouped with. +# Defaults to none. +#------------------------------------------------------------------------------- + +# The following topics are defined in the main file, if you'd like to alter +# their behavior or add keywords: +# +# Generic, Class, Interface, Section, File, Group, Function, Variable, +# Property, Type, Constant, Enumeration, Event, Delegate, Macro, +# Database, Database Table, Database View, Database Index, Database +# Cursor, Database Trigger, Cookie, Build Target + +# If you add something that you think would be useful to other developers +# and should be included in Natural Docs by default, please e-mail it to +# topics [at] naturaldocs [dot] org. -- cgit v1.2.3 From a25471b0c682c4e0f04bef536da5c8f248d25c4f Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 29 Aug 2008 16:27:36 +0200 Subject: NaturalDocs/ObjC.pm: Add copyright notice. --- NaturalDocs/ObjC.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/NaturalDocs/ObjC.pm b/NaturalDocs/ObjC.pm index 2c78478..ad726a1 100755 --- a/NaturalDocs/ObjC.pm +++ b/NaturalDocs/ObjC.pm @@ -8,6 +8,22 @@ # ############################################################################### +## Copyright 2008, Matthias Andreas Benkard. +## +## This package is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This package is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this package; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + use strict; use integer; @@ -25,8 +41,6 @@ sub OnCode my $line = $codeLines->[0]; if ($lastCommentTopicCount) { - #print "$topic\n"; - #print "$line\n"; unless ($topic->Prototype()) { my $code = join ("\n", @{$codeLines}); @@ -52,8 +66,6 @@ sub ParsePrototype { my ($self, $topic_type, $prototype) = @_; - #print "$prototype\n"; - $_ = $prototype; if ($topic_type == ::TOPIC_FUNCTION and /([-+]\s*\((.*?)\)\s*)(.*)/) { @@ -64,7 +76,6 @@ sub ParsePrototype $_ = $3; while (/(\S+)\((.*?)\)\s*(\S+)(?:(\s+(.*))?|$)/) { - #print "$4, $1, $2, $3\n"; $p->AddParameter (NaturalDocs::Languages::Prototype::Parameter->New ("($2)", $1, $3, -- cgit v1.2.3 From ea78de039ba122180ac0fe7ffbdca4073342ad0c Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 29 Aug 2008 16:28:18 +0200 Subject: MLKCons: Fix a typo in the documentation. --- MLKCons.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MLKCons.h b/MLKCons.h index 79712cb..4b46272 100644 --- a/MLKCons.h +++ b/MLKCons.h @@ -81,7 +81,7 @@ */ -(void) setCar:(id)value; -/* Method: setCdr: +/* Method: -setCdr: Change the cdr of the cons cell. */ -- cgit v1.2.3