# HG changeset patch # User Claus Gittinger # Date 1018259378 -7200 # Node ID 453fa7d784376500e33de3682cb3e045093ae805 # Parent 31c19f47395b1565e5a2954a87971c90fc17dd23 *** empty log message *** 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