I am trying to implement does_key_exist, I thought the code below would do it. But I get a compilation error key not found line: Result := not (x.key = key)
does_key_exist(key: attached STRING):BOOLEAN
do
Result := not data.item(hash(key)).for_all (agent (x:like pair_at):BOOLEAN
do
Result := not equal(x.key, key)
end)
end
definitions:
pair_at(key:attached STRING):TUPLE[key:STRING;value: like value_at]
require
does_key_exist(key)
deferred
ensure
end
list_at(key:STRING) : LINKED_LIST[like pair_at]
require
does_key_exist(key)
end
data : ARRAY[like list_at]