#FEATURE by cg
class: VariableNode
added: #isGlobalVariableNamed:
changed: #isGlobalNamed:
--- a/VariableNode.st Sun Sep 23 01:23:05 2018 +0200
+++ b/VariableNode.st Sun Sep 23 01:26:50 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1994 by Claus Gittinger
All Rights Reserved
@@ -953,7 +955,6 @@
"Modified: / 05-12-2011 / 18:43:56 / cg"
! !
-
!VariableNode methodsFor:'printing & storing'!
displayOn:aGCOrStream
@@ -1082,14 +1083,18 @@
!
isGlobalNamed:nameWanted
- "return true, if this is a node for a particular global variable"
+ "return true, if this is a node for a particular
+ (and existing) global variable"
+ |sym|
+
^ (type == #GlobalVariable)
and:[name = nameWanted
- and:[name isSymbol
+ and:[(sym := name asSymbolIfInterned) isSymbol
and:[Smalltalk includesKey:name]]]
"Created: / 05-03-2007 / 13:35:07 / cg"
+ "Modified: / 22-09-2018 / 17:27:58 / Claus Gittinger"
!
isGlobalVariable
@@ -1098,6 +1103,16 @@
^ type == #GlobalVariable
!
+isGlobalVariableNamed:nameWanted
+ "return true, if this is a node for a particular
+ global variable (existing or not) "
+
+ ^ (type == #GlobalVariable)
+ and:[name = nameWanted]
+
+ "Created: / 22-09-2018 / 17:26:50 / Claus Gittinger"
+!
+
isInstance
<resource: #obsolete>