Index: trunk/doc/user/06_feature/query/lang.html =================================================================== --- trunk/doc/user/06_feature/query/lang.html (revision 32031) +++ trunk/doc/user/06_feature/query/lang.html (revision 32032) @@ -82,21 +82,20 @@
-An expression returns a value. A value can be: +An expression is evaluated to a value. A value can be:
A value is considered true if:
@@ -108,13 +107,13 @@
-If the EXPR in an assert evaluates to false, a DRC violation is generated. +When running the DRC, if the EXPR in an assert evaluates to false, a +DRC violation is generated. The return value of such an expression should +normally be a list generated using the violation() function, so that it +can pass on all relevant details (such as expected value, affected objects) +to the DRC display. +
+When running a search, normally the result of an assert should be an object.
-If an assert EXPR is a list anywhere else than in a function argument, it is -evaluated for all valid members of the list (see P45, P46). For example +If an EXPR references a variable (list), it is evaluated for all +valid members of the list (see P45, P46), in order of the list. For example if there is a variable called FOO, which is a list of objects (built using a search statement), expression
@@ -162,6 +167,18 @@ if FOO.p.clearance is smaller than 10 mil, the right size is not evaluated. See also: P45, P46.+If a function needs to be called with a whole list passed instead of +calling to function for each element of the list, the special list() +built-in function should be used. For example assume FOO is a list of 5 +objects: +
+llen(list(FOO)) +++will pass FOO as a list to function llen(), which is called only once. Without +the list() wrapping, llen() would be called five times, once for each item +in the list. +
A field reference is valid if the field exists. For example a line object has a thickness attribute, thus the .p.thickness is valid, but a polygon object does not have a thickness and .p.thickness on a polygon is invalid.