ohash

Synopsis

% ohash(key => value, ...)

Creates an ordered Sleep hash. All keys are stored in insertion order.

Parameters

key => value - a key/value pair to populate the hash with.

... - any number of key/value pairs may be specified.

Returns

An ordered hash

Side Effects / Notes

Examples

%random = %(a => "apple", b => "boy", c => "cat", d => "dog"); println("Random: " . %random); %ordered = ohash(a => "apple", b => "boy", c => "cat", d => "dog"); println("Ordered: " . %ordered);

Random: %(d => 'dog', a => 'apple', c => 'cat', b => 'boy') Ordered: %(a => 'apple', b => 'boy', c => 'cat', d => 'dog')

See Also