Changes between Version 3 and Version 4 of Doc/panc/dml/flow


Ignore:
Timestamp:
Jun 15, 2007, 8:41:09 PM (17 years ago)
Author:
/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Charles Loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/panc/dml/flow

    v3 v4  
    3333The 'foreach' statement allows iteration over all of the elements of a list or hash.  The syntax is:
    3434{{{
    35 foreach (key, value, resource) body-dml;
     35foreach (key; value; resource) body-dml;
    3636}}}
    3737This will cause the body-dml to be executed once for each element in resource (a list or hash).  The local variables 'key' and 'value' (you can choose these names) will be set at each iteration to the key and value of the element.  For a list, the key is the element's index.  The iteration will always occur in the natural order of the resource: ordinal order for lists and lexical order of the keys for hashes.