A block object defines a sequence of code objects with a formal parameter list.
On block->forward,
the var objects in block<-parameters
will be bound to the forwarded arguments (exceeding arguments are bound
to
@arg1 ...) and
the and<-members
statements of the block are executed just as with the super-class and.
Example:
?- send(block(new(X, var),
message(@pce, write_ln, X)),
forward,
'Hello World').
Hello World.
->assign)
by
block->forward.
<-parameters
by position. Possible exceeding arguments are bound to @arg1
... for compatibility reasons. Next the block is code->execute’d
just like the and object.
Example:
?- send(chain(chain(a,b), chain(c,d)), for_all,
block(new(Sub, var),
message(Sub, for_all,
message(@pce, write_ln, Sub, @arg1)))).