01_user_documentation:07_rgg_xl:02_xl:03_query:01_predicate:01_node:04_unary
This is an old revision of the document!
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) ::> println(o) ; ] protected void init () [ Axiom ==> for (int i:1:10) ( Organ(i) ); ]
01_user_documentation/07_rgg_xl/02_xl/03_query/01_predicate/01_node/04_unary.1755858725.txt.gz · Last modified: 2025/08/22 12:32 by gaetan
