# hash-table

forwardable -i <> =
{
  @spec 
  {
    int length (forwardable _);
    ulong -a is_empty (forwardable _);
  }
  [local]
  {
    void make_iterator (pulong64 -w access_code, forwardable _);
    ulong -a has_next (forwardable _, ulong64 access_code);
    void next_iterator (pulong64 -&w access_code, forwardable _);
    void delete_iterator (pulong64 -&w, forwardable _);

    "get_current";
  }
};

hash_table <key, value> =
{
  @spec
  {
    void set (hash_table -&w _, key _, value _);
    void set (hash_table -&w _, ulong64 access_code, value _);

    ulong get (pvalue -w _, hash_table _, key _);
    ulong -a contains (hash_table _, key _);

    ulong get (pvalue -w _, hash_table _, pulong64 access_code);
    ulong -a contains (pulong64 -w access_code, hash_table _, key _);

    int length (hash_table _);
    ulong -a is_empty (hash_table _);
  }
};