Creates an ordered Sleep hash. All keys are stored in access order from least to most recently accessed.
key => value - a key/value pair to populate the hash with.
... - any number of key/value pairs may be specified.
An ordered hash
%random = %(a => "apple", b => "boy", c => "cat", d => "dog"); println("Random: " . %random); %ordered = ohasha(a => "apple", b => "boy", c => "cat", d => "dog"); println("Ordered: " . %ordered); println("Accessing 'a': " . %ordered['a']); println("Ordered: " . %ordered);
Random: %(d => 'dog', a => 'apple', c => 'cat', b => 'boy') Ordered: %(a => 'apple', b => 'boy', c => 'cat', d => 'dog') Accessing 'a': apple Ordered: %(b => 'boy', c => 'cat', d => 'dog', a => 'apple')