Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Fold (MPI)

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
m (MPI fold moved to Fold (MPI))
 
(One intermediate revision not shown)
Line 1: Line 1:
-
[[Category:MPI functions]]
+
[[Category:functions (MPI)]][[Category:Looping Functions (MPI)]]
=fold=
=fold=
<mpi>{fold:var1,var2,list,expr}
<mpi>{fold:var1,var2,list,expr}

Latest revision as of 01:38, 31 March 2007

fold

{fold:var1,var2,list,expr}
{fold:var1,var2,lst,expr,sep}

This takes a list and stores the first two items in var1 and var2, then evaluates expr.

The value returned by expr is then put in var1, and the next list item is put in var2. Expr keeps being evaluated in this way until there are no more list items left.

This returns the last value returned by expr. If a sep argument is given, the input list is assumed to have its individual items delimited by that string, otherwise it assumes a carriage return.

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox