PreviousUpNext

Red-Black Trees: Listing Keys, Values and Key-Value Pairs

We might want to know what keys, values, or key-value pairs it contained:

    linux$ my
    eval:  include package   string_map;
    eval:  m = empty: Map( String );
    eval:  m $= ("Key1", "Value1");
    eval:  m $= ("Key2", "Value2");
    eval:  m $= ("Key3", "Value3");

    eval:  keys_list m;

    ["Key1", "Key2", "Key3"]

    eval:  vals_list m;

    ["Value1", "Value2", "Value3"]

    eval:  keyvals_list m;

    [("Key1", "Value1"), ("Key2", "Value2"), ("Key3", "Value3")]

Comments and suggestions to: bugs@mythryl.org

PreviousUpNext