diff -r 31c19f47395b -r 453fa7d78437 SnapShotImage.st --- a/SnapShotImage.st Thu Mar 28 13:58:16 2002 +0100 +++ b/SnapShotImage.st Mon Apr 08 11:49:38 2002 +0200 @@ -134,6 +134,27 @@ ^ globals at:aKey ifAbsent:exceptionValue ! +classNamed:aString + "return the class with name aString, or nil if absent. + To get to the metaClass, append ' class' to the string." + + |cls sym meta| + + "be careful, to not invent new symbols ..." + sym := aString asSymbol. + cls := self at:sym ifAbsent:[]. + cls isBehavior ifTrue:[^ cls]. + + (aString endsWith:' class') ifTrue:[ + + meta := self classNamed:(aString copyWithoutLast:6). + meta notNil ifTrue:[ + ^ meta class + ]. + ]. + ^ nil +! + keysAndValuesDo:aTwoArgBlock globals isNil ifTrue:[ self fetchGlobals