dos_key_exist を実装しようとしていますが、以下のコードで実行できると思いました。しかし、コンパイルエラー key not found 行が表示されます: 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
定義:
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]