src/swipl-devel/packages/xpce/man/refmanual/md/block.md

class block {#class-block}

A block object defines a sequence of code objects with a formal parameter list.

On ->forward, the var objects in <-parameters will be bound to the forwarded arguments (exceeding arguments are bound to @arg1 ...) and the <-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.

@see class ?

Instance variables {#class-block-instvars}

Send methods {#class-block-send}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.