| Did you know ... | Search Documentation: |
| Finding objects |
Finding objects in a collection
The following example shows how one can find an object in a chain that has a certain name.
This example uses the equality code class _==_ to perform the test.
The method chain<-find
executes the code argument successively on the elements of the chain,
forwarding each element via @arg1.
As soon as the code returns success, the value is returned.
find_named_in_chain(Chain, Name, Obj) :-
get(Chain, find, @arg1?name == Name, Obj).
<-find <-find <-find <-find