Recherche Google
OM 6.5 – User ManualVisual Programming II > Control Structures > Predicates
page précédentepage suivante

Predicates : Testing Relations and Properties

Predicate

The concept of predicate refers to a property, or to a relation between the terms of a proposition.

A predicates is a boolean operators : it is a function which tests for a condition involving its arguments. If the condition is fulfilled, the operator returns "true" or "false" – "yes" or "no".

In Lisp, "nil" means "false", and "t" means "true". As a convention, any non nil value is also interpreted as "true".

There are several types of predicates. Among these, algebraic predicates compare numbers, equality predicates test if two objects are identical, type predicates that test if an object belongs to a specific type, and so on.

In OM, predicates are often used as conditions for the execution of a program.

Arguments and Evaluation of Predicate Boxes

Predicates can take arguments directly from their inputs or from other boxes. They are evaluated like any other box. Evaluation returns either "t" or "nil".

Using Predicates in Conditional Structures
Predicates in Lisp

More information about predicates in Common Lisp can be found here.

page précédentepage suivante
A propos...(c) Ircam - Centre PompidouRéalisé avec Scenari