Smalltalk/X WebserverDocumentation of class 'VirtualDictionaryWithCache': | |
Class: VirtualDictionaryWithCacheInheritance:Object | +--Collection | +--VirtualDictionary | +--VirtualDictionaryWithCache
Description:similar to my superclass, but I remember already encountered and computed values. Useful if the computation is expensive. For example, VirtualDictionaryWithCache new fetchBlock:[:key | Transcript showCR: e'computing value for {key}...'. key squared ] will respond to: at:4 with 16. when asked again, the remembered value (as per key) will be returned. Caveat: a virtual dictionary does not support: size do: (and all other enumeration messages) actually it does not behave at all like a dictionary. Instance protocol:accessing
|
|
ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:55:57 GMT |