9903bb35d703 — Gerald Klix (speedy) 10 months ago
SUM: Fix bug #3.

FIX: Don't create modules on code inspection.
1 files changed, 15 insertions(+), 6 deletions(-)

M environments/SimpleEnvironments.pck.st
M environments/SimpleEnvironments.pck.st +15 -6
@@ 1,6 1,6 @@ 
-'From Haver 5.0 [latest update: #4999] on 10 December 2021 at 3:39:02 pm'!
+'From Haver 6.0 [latest update: #5044] on 20 January 2022 at 12:12:33 pm'!
 'Description A simple environments implementation, meant as an example and a base to inherit from for your own implementations.'!
-!provides: 'SimpleEnvironments' 1 44!
+!provides: 'SimpleEnvironments' 1 45!
 !requires: 'EnvironmentsBase' 1 21 nil!
 SystemOrganization addCategory: 'SimpleEnvironments'!
 

          
@@ 646,6 646,17 @@ newEnvironment: aName
 		at: (nameSymbol _ self convertToEnvironmentName: aName)
 		put: (self environmentClass named: nameSymbol)! !
 
+!SimpleEnvironmentManager methodsFor: 'accessing' stamp: 'KLG 1/20/2022 11:58:57'!
+nonPersistentEnvironment: aName
+	"Answer the environment denoted by aName.
+	
+	Don't create it, if none exists."
+
+	| nameSymbol |
+	^ environments
+		at: (nameSymbol _ self convertToEnvironmentName: aName)
+		ifAbsent: [ self environmentClass named: nameSymbol ].! !
+
 !SimpleEnvironmentManager methodsFor: 'accessing' stamp: 'Install-4565-CuisCore-GeraldKlix-2021Mar14-14h28m-KLG.004.cs.st 3/14/2021 14:45:03'!
 removeEnvironment: aName
 	"Answer the environment denoted by aName."

          
@@ 772,7 783,7 @@ allBehaviorsDo: aBlock
 
 	environments do: [ :environment | environment allBehaviorsDo: aBlock ]! !
 
-!SimpleEnvironmentManager methodsFor: 'scanning' stamp: 'KLG 5/4/2021 21:02:46'!
+!SimpleEnvironmentManager methodsFor: 'scanning' stamp: 'KLG 1/20/2022 11:59:08'!
 scanClassDenotation: aClassDenotation
 	"Scan aClassDenotation, answer nil if the denotation is not handled by this environment implementation."
 

          
@@ 782,9 793,7 @@ scanClassDenotation: aClassDenotation
 	aClassDenotation first == self class singleInstanceGlobalName ifFalse: [ ^ nil ].
 	aClassDenotation second == #>> ifFalse: [ ^ nil ].
 	aClassDenotation fourth == #>> ifFalse: [ ^ nil ].
-	self flagHaver:
-		'TODO: Replace "self environment:" with something that does not define an environment.'.
-	^ aClassDenotation fifth forEnvironment: (self environment: aClassDenotation third)! !
+	^ aClassDenotation fifth forEnvironment: (self nonPersistentEnvironment: aClassDenotation third)! !
 
 !SimpleEnvironmentManager class methodsFor: 'instance creation' stamp: 'KLG 10/6/2020 14:58:11'!
 environment: aNameSymbol