--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/VirtualDictionary.st Fri Dec 22 15:25:48 2017 +0100
@@ -0,0 +1,56 @@
+"{ Package: 'stx:libbasic2' }"
+
+"{ NameSpace: Smalltalk }"
+
+Collection subclass:#VirtualDictionary
+ instanceVariableNames:'fetchBlock'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Collections-Unordered'
+!
+
+!VirtualDictionary class methodsFor:'documentation'!
+
+documentation
+"
+ a collection which looks like a (read-only) dictionary to the outside,
+ but invokes a pluggable fetchBlock to retrieve keys.
+
+ [author:]
+ cg
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!VirtualDictionary methodsFor:'accessing'!
+
+at:aKey ifAbsent:exceptionValue
+ |value|
+
+ value := fetchBlock value:aKey.
+ value isNil ifTrue:[
+ ^ exceptionValue value
+ ].
+ ^ value
+!
+
+fetchBlock:something
+ fetchBlock := something.
+! !
+
+!VirtualDictionary class methodsFor:'documentation'!
+
+version
+ ^ '$Header$'
+!
+
+version_CVS
+ ^ '$Header$'
+! !
+