Perform a broadcast get operation on objects object<-hypered
to this object. If a hyper_name is given only hypers with this name are
considered. Otherwise all hypers are considered. As soon as one of the
hypered objects returns a value, this method returns with this value.
Otherwise the method fails. Example:
?- new(@o, object),
new(_, hyper(@o, bitmap('pce.bm'), bitmap)),
new(_, hyper(@o, text(hello), text)).
?- pce_catch_error(no_behaviour,
get(@o, get_hyper,
@default, string, S).
S = hello
?- pce_catch_error(no_behaviour,
get(@o, get_hyper,
@default, pixel, 3, 5, P).
P = @off
The first query is answered by the text
object, while the latter is answered by the bitmap
object (delegated to the bitmap<-image).
Note the use of pce_catch_error/2 to avoid
an error while broadcasting to objects that do not understand the
method.