User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:03_query:01_predicate:01_node:04_unary

Table of Contents

Unary

An unary predicate enables the use of boolean methods as patterns. The methods needs to:

  • return a boolean
  • have at least one argument, and its first argument is of type Node (or extend Node)

Such a method is called on the Node tested, and will use it as an implicit argument. The type of node is also implicit from the method argument.

Example

module Organ(int age);
 
boolean isAge(Organ o, int i){
	return o[age] == i;
}
 
public void run ()
[
	o:isAge(5) isAge(6) ::> ; // o is an Organ of "age" 5 which have a successor Organ of age 6
]
01_user_documentation/07_rgg_xl/02_xl/03_query/01_predicate/01_node/04_unary.txt · Last modified: 2025/08/22 12:32 by gaetan