[ooc-compiler] Usage of ADT:Dictionary
Brought to you by:
mva
|
From: vedmed <ve...@in...> - 2005-06-26 09:53:21
|
The library oo2c contains very useful object ADT:Dictionary.Dictionary. This object has procedure of check of existence of a key and procedure of reception of value on a key, but does not contain procedure returning simultaneously value on a key, and an attribute of existence instead of exception. It compels in cases similar to ... d: SomeDictionary; ... IF d.HasKey(key) THEN val := d.Get(key); val.DoSomething(); ELSE ... perform search under the dictionary twice, instead of once, like ... IF d.Find(key, val) THEN val.DoSomething(); ELSE ... I can easily add manually such procedure in module Dictionary, but would like to see it in structure of standard library. However if there are basic objections against existence of such procedure I would like them to hear. |