SequenceableCollection.st
branchjv
changeset 18059 b882507b9fdf
parent 18057 8da7c39a6322
parent 15215 14ec9c600861
child 18063 4a8226cd76ab
--- a/SequenceableCollection.st	Tue Apr 30 10:54:00 2013 +0100
+++ b/SequenceableCollection.st	Tue May 21 21:58:09 2013 +0100
@@ -7191,6 +7191,28 @@
     "
 
     "Modified: / 16.5.1998 / 20:21:46 / cg"
+!
+
+map:values at:key ifAbsent:exceptionValue
+    "the receiver is interpreted as a collection of keys;
+     find key in the receiver and return the corresponding value
+     from the valuesCollection argument."
+
+    |idx|
+
+    idx := self indexOf:key.
+    idx == 0 ifTrue:[^ exceptionValue value].
+    ^ values at:idx
+
+    "
+     #(16 32 128 256 512 1024) 
+        map: #('ipc4' 'ipc5' 'ic07' 'ic08' 'ic09' 'ic10')
+        at:128 ifAbsent:nil 
+
+     #(16 32 128 256 512 1024) 
+        map: #('ipc4' 'ipc5' 'ic07' 'ic08' 'ic09' 'ic10')
+        at:64 ifAbsent:nil 
+    "
 ! !
 
 !SequenceableCollection methodsFor:'searching-equality'!
@@ -8912,11 +8934,11 @@
 !SequenceableCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.336 2013-04-26 11:36:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.338 2013-05-06 13:35:25 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.336 2013-04-26 11:36:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.338 2013-05-06 13:35:25 cg Exp $'
 ! !