% crochet

effect nonlocal-return with
  push(value);
end

command list find: (Predicate is (A -> boolean)) do
  handle
    for X in self if Predicate(X) do
      perform nonlocal-return.push(#result ok: X);
    end
    #result error: not-found;
  with
    on nonlocal-return.push(X) => X;
  end
end