MCClassDefinition.st
changeset 156 d565f9e9cee1
parent 48 1e383209540d
child 214 95e0329274f2
--- a/MCClassDefinition.st	Mon Oct 26 18:54:19 2009 +0100
+++ b/MCClassDefinition.st	Mon Oct 26 20:38:52 2009 +0100
@@ -222,17 +222,23 @@
 !MCClassDefinition methodsFor:'installing'!
 
 createClass
-	| superClass |
-	superClass _ Smalltalk at: superclassName.
-	^ (ClassBuilder new)
-			name: name 
-			inEnvironment: superClass environment 
-			subclassOf: superClass
-			type: type 
-			instanceVariableNames: self instanceVariablesString 
-			classVariableNames: self classVariablesString 
-			poolDictionaries: self sharedPoolsString
-			category: category
+        | superClass rslt |
+        superClass _ Smalltalk at: superclassName.
+        rslt := (ClassBuilder new)
+                        name: name 
+                        inEnvironment: superClass environment 
+                        subclassOf: superClass
+                        type: type 
+                        instanceVariableNames: self instanceVariablesString 
+                        classVariableNames: self classVariablesString 
+                        poolDictionaries: self sharedPoolsString
+                        category: category.
+
+        "/ ST/X returns the builder; squeak the ready-made class
+        Smalltalk isSmalltalkX ifTrue: [
+            rslt := rslt buildClass.
+        ].  
+        ^ rslt
 !
 
 load
@@ -326,17 +332,17 @@
 type: typeSymbol
 comment: commentString
 commentStamp: stampStringOrNil
-	name _ nameString asSymbol.
-	superclassName _ superclassString ifNil: ['nil'] ifNotNil: [superclassString asSymbol].
-	category _ categoryString.
-	name = #CompiledMethod ifTrue: [type _ #compiledMethod] ifFalse: [type _ typeSymbol].
-	comment _ commentString withSqueakLineEndings.
-	commentStamp _ stampStringOrNil ifNil: [self defaultCommentStamp].
-	variables _ OrderedCollection  new.
-	self addVariables: ivarArray ofType: MCInstanceVariableDefinition.
-	self addVariables: cvarArray ofType: MCClassVariableDefinition.
-	self addVariables: poolArray ofType: MCPoolImportDefinition.
-	self addVariables: civarArray ofType: MCClassInstanceVariableDefinition.
+        name _ nameString asSymbol.
+        superclassName _ superclassString ifNil: ['nil'] ifNotNil: [superclassString asSymbol].
+        category _ categoryString.
+        name = #CompiledMethod ifTrue: [type _ #compiledMethod] ifFalse: [type _ typeSymbol].
+        commentString notNil ifTrue:[ comment _ commentString withSqueakLineEndings ].
+        commentStamp _ stampStringOrNil ifNil: [self defaultCommentStamp].
+        variables _ OrderedCollection  new.
+        self addVariables: ivarArray ofType: MCInstanceVariableDefinition.
+        self addVariables: cvarArray ofType: MCClassVariableDefinition.
+        self addVariables: poolArray ofType: MCPoolImportDefinition.
+        self addVariables: civarArray ofType: MCClassInstanceVariableDefinition.
 ! !
 
 !MCClassDefinition methodsFor:'testing'!
@@ -366,5 +372,9 @@
 !MCClassDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassDefinition.st,v 1.1 2006-11-22 13:09:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassDefinition.st,v 1.2 2009-10-26 19:38:52 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassDefinition.st,v 1.2 2009-10-26 19:38:52 cg Exp $'
 ! !