ConstNode.st
changeset 98 ccc7f9389a8e
parent 96 ae3b3d960476
child 102 77e4d1119ff2
--- a/ConstNode.st	Mon Jul 03 04:38:59 1995 +0200
+++ b/ConstNode.st	Sun Jul 23 04:24:56 1995 +0200
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libcomp/Attic/ConstNode.st,v 1.11 1995-06-27 02:17:11 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/ConstNode.st,v 1.12 1995-07-23 02:23:30 claus Exp $
 '!
 
 !ConstantNode class methodsFor:'documentation'!
@@ -43,7 +43,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libcomp/Attic/ConstNode.st,v 1.11 1995-06-27 02:17:11 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/ConstNode.st,v 1.12 1995-07-23 02:23:30 claus Exp $
 "
 !
 
@@ -64,6 +64,10 @@
 	^ #Integer
     ].
 
+    anObject isNil ifTrue:[
+	^ #Nil
+    ].
+
     anObject isNumber ifTrue:[
 	"the most common case first ..."
 	(anObject isMemberOf:Float) ifTrue:[
@@ -73,9 +77,6 @@
 	    ^ #Integer
 	].
     ].
-    anObject isNil ifTrue:[
-	^ #Nil
-    ].
     (anObject == true) ifTrue:[
 	^ #True
     ].
@@ -87,6 +88,10 @@
 
 !ConstantNode class methodsFor:'instance creation'!
 
+value:val
+    ^ self type:(self typeOfConstant:val) value:val 
+!
+
 type:t value:val
     "some constant nodes are used so often, its worth caching them"
     (t == #True) ifTrue:[