RGClassDefinition.st
changeset 3 ed5aae792d24
parent 0 43cb9f3e345e
child 5 5cc2caa88b23
--- a/RGClassDefinition.st	Sat Aug 29 10:31:59 2015 +0100
+++ b/RGClassDefinition.st	Mon Aug 31 14:01:56 2015 +0100
@@ -14,13 +14,34 @@
 
 !RGClassDefinition class methodsFor:'instance creation'!
 
-createSharedPoolNamed: aSymbol
+newClass
+    "Creates new class definition (along with it's metaclass)"
+
+    ^ self new withMetaclass
+
+    "Created: / 29-08-2015 / 12:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-08-2015 / 11:54:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+newSharedPool
+    "A shared pool is a class inheriting from #SharedPool"
+    
+    ^ RGClassDefinition newClass
+        superclassName:#SharedPool;
+        isPool:true;
+        yourself
+
+    "Created: / 29-08-2015 / 11:54:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+newSharedPoolNamed:aSymbol 
     "A shared pool is a class inheriting from #SharedPool"
 
-    ^(RGClassDefinition named: aSymbol)
-            superclassName: #SharedPool;
-            isPool: true;
-            yourself
+    ^ self newSharedPool
+        name: aSymbol;
+        yourself
+
+    "Modified: / 29-08-2015 / 11:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !RGClassDefinition methodsFor:'accessing'!
@@ -67,6 +88,15 @@
      
 !
 
+name: aString
+    super name: aString.
+    (metaClass notNil and:[metaClass name isNil]) ifTrue:[ 
+        metaClass name: aString, ' class'.
+    ].
+
+    "Created: / 29-08-2015 / 12:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 package
     "Retrieves the package in which this class is contained, if exists"
     
@@ -318,3 +348,4 @@
         and:[ (self theMetaClass isSameRevisionAs: aRGClassDefinition theMetaClass) ] ] ] ] ] ] ]
 ! !
 
+