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

class and {#class-and}

Class and defines a logical and for its associated statements. An and object is not just binary but can have any number of arguments, so one may state

and(Statement1, Statement2, Statement3)

rather then

and(Statement1, and(Statement2, Statement3))

When executed, the and will execute its argument code objects starting from the first. It stops with failure as soon as one of the arguments fails or returns success if all arguments succeed. And objects are both used as a logical connective for conditions (see class if) and as a sequence of statements.

An and object without arguments simply succeeds and is the fastest succeeding code object.

See also class block, class or and class not. Class progn defines a function equivalent of an and.

@see class progn @see topic Conditions

Instance variables {#class-and-instvars}

Send methods {#class-and-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.