| Did you know ... | Search Documentation: |
| chain->for_all |
@arg1 Current element. @arg2 Index of the element (1-based)
The iteration stops with failure if the execution of code
fails for some element of the chain.
In the example below we print the elements of a chain on the terminal:
?- new(@ch, chain(hello, world)). ?- send(@ch, for_all, message(@pce, write_ln, @arg1)). hello world
If the safe argument is @on
(default), the elements of the chain are first copied to a local array
and existence of the objects in the elements is tested prior to
executing the code
object. This implies that the chain may be modified by the execution of
the method and new elements will not be seen. If this argument is @off
this method iterates over the chain itself. In this case it is not
allowed to modify the chain.
Defaults: By default this operation is caried-out safe
(= @on).
<-find_all <-find ->find ->for_some ->for_all ->for_all