Changes between Version 3 and Version 4 of Doc/panc/stdtpl/functions


Ignore:
Timestamp:
Nov 30, 2007, 11:51:35 AM (16 years ago)
Author:
/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Charles Loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/panc/stdtpl/functions

    v3 v4  
    1212Often one want to add elements to a resource (list or hash) incrementally with a sequence of assignment statements.  Those assignment statements usually being in different templates.  The following functions provide simple mechanisms to do so.
    1313
    14 '''push(element...)'''
     14=== push(element...) ===
    1515
    1616This function will return a copy of self with the given value(s) appended to the end.  If self is undefined, the function will create a new list with the arguments and return that.  An example is
     
    3030will leave '/mylist' with the one-element list 'b'.
    3131
    32 '''push_if(boolean, element...)'''
     32=== push_if(boolean, element...) ===
    3333
    3434This function behaves exactly like push() except that the first argument determines whether or not to add the rest of the arguments to the value of self.  If the value is false, the function will return an empty list.  As for push(), this function will create a new list if self is undefined.  See also the warning about multiple calls to push() within the same DML block; this warning also applies here.
    3535
    36 '''npush(element...)'''
     36=== npush(element...) ===
    3737
    3838This function will return a copy of self with the given value(s) inserted into the nlist.  The number of arguments must be even; each pair will be treated as a key/value.  If self is undefined, the function will create a new nlist with the arguments and return that.  An example is
     
    5454
    5555== 'object' Utility Functions ==
    56 
    57