Child list rule

Overview

How To

Related Topics


A Child List Rule defines an attribute whose returned value is a list of instances. The system creates the list of instances inside the object in whose class the rule appears. This is a way to create, in one rule, a collection of related object instances.

You must specify the integer pseudo-parameter "quantity" for a child list rule. The quantity parameter indicates how many child instance objects to create. No attribute for the quantity is created, and it is therefore not directly inspectable. The Quantity pseudo-parameter is required when using Child List; if you fail to supply it, a parse error occurs.

Every  child list instance created has an attribute called "Index" whose value is incremented by one as each instance is created. The value of this attribute can be used to distinguish one member of the set from another.

All normal parameters in the Child specification may refer to the child's index with the ordinary reference chain "child:index:". The Class pseudo-parameter and the Quantity pseudo-parameter cannot use child:index:.

Child List does not evaluate the parameter value expressions until they're demanded.

Syntax Example:

(Child List) Circles: {

     Class; ug_arc;

     radius; .5;

     center; point(child:index:; 5; 0);

     quantity; 10;

};