From 249175b68c3cb9d9b146c3930ae62cb2712f8d1a Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Fri, 8 Aug 2008 19:09:24 +0200 Subject: Make MLKPackage Fix-and-Continue-friendly. --- MLKPackage.m | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/MLKPackage.m b/MLKPackage.m index 256b6a9..f867694 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -33,26 +33,39 @@ static NSMutableDictionary *packages = nil; @implementation MLKPackage +(void) initialize { - packages = [[NSMutableDictionary alloc] init]; - - MLKPackage *cl = [MLKPackage packageWithName:@"COMMON-LISP" - nicknames:[NSSet setWithObject:@"CL"]]; - MLKPackage *clUser = [MLKPackage packageWithName:@"COMMON-LISP-USER" - nicknames:[NSSet setWithObject:@"CL-USER"]];; - MLKPackage *sys = [MLKPackage packageWithName:@"TOILET-SYSTEM" - nicknames:[NSSet setWithObjects: - @"TL-SYS", @"SYSTEM", - @"SYS", nil]]; - MLKPackage *toilet = [MLKPackage packageWithName:@"TOILET-LISP" - nicknames:[NSSet setWithObjects: - @"TL", @"TOILET", nil]]; - MLKPackage *tlUser = [MLKPackage packageWithName:@"TOILET-LISP-USER" - nicknames:[NSSet setWithObjects: - @"TL-USER", - @"TOILET-USER", - nil]]; - - [MLKPackage packageWithName:@"KEYWORD" nicknames:[NSSet set]]; + MLKPackage *cl, *clUser, *sys, *toilet, *tlUser; + + if (!packages) + { + packages = [[NSMutableDictionary alloc] init]; + + cl = [MLKPackage packageWithName:@"COMMON-LISP" + nicknames:[NSSet setWithObject:@"CL"]]; + clUser = [MLKPackage packageWithName:@"COMMON-LISP-USER" + nicknames:[NSSet setWithObject:@"CL-USER"]];; + sys = [MLKPackage packageWithName:@"TOILET-SYSTEM" + nicknames:[NSSet setWithObjects: + @"TL-SYS", @"SYSTEM", + @"SYS", nil]]; + toilet = [MLKPackage packageWithName:@"TOILET-LISP" + nicknames:[NSSet setWithObjects: + @"TL", @"TOILET", nil]]; + tlUser = [MLKPackage packageWithName:@"TOILET-LISP-USER" + nicknames:[NSSet setWithObjects: + @"TL-USER", + @"TOILET-USER", + nil]]; + + [MLKPackage packageWithName:@"KEYWORD" nicknames:[NSSet set]]; + } + else + { + cl = [self findPackage:@"COMMON-LISP"]; + clUser = [self findPackage:@"COMMON-LISP-USER"]; + sys = [self findPackage:@"TOILET-SYSTEM"]; + toilet = [self findPackage:@"TOILET-LISP"]; + tlUser = [self findPackage:@"TOILET-LISP-USER"]; + } [cl usePackage:sys]; -- cgit v1.2.3