--- a/OrderedDictionary.st Tue Jan 24 12:22:23 2017 +0100
+++ b/OrderedDictionary.st Tue Jan 24 15:58:04 2017 +0100
@@ -313,6 +313,28 @@
"
!
+firstKey
+ "Return the first key of the receiver.
+ Raises an error if the receiver contains no elements."
+
+ ^ order first
+
+ "
+ OrderedDictionary new first
+ OrderedDictionary new firstKey
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ first
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ firstKey
+ "
+!
+
keyAt:index
"get the key at the given index"
@@ -354,6 +376,28 @@
"
!
+lastKey
+ "Return the last key of the receiver.
+ Raises an error if the receiver contains no elements."
+
+ ^ order last
+
+ "
+ OrderedDictionary new last
+ OrderedDictionary new lastKey
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ last
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ lastKey
+ "
+!
+
order
"returns the keys in the order of their appearance"