Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Filter (MPI)

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
m (Corrected link(s) with new MPI naming scheme.)
 
(2 intermediate revisions not shown)
Line 1: Line 1:
-
[[Category:MPI functions]]
+
[[Category:functions (MPI)]][[Category:Looping Functions (MPI)]]
=filter=
=filter=
<mpi>{filter:var,list,expr}
<mpi>{filter:var,list,expr}
Line 6: Line 6:
This evaluates expr for each and every item in the given list.
This evaluates expr for each and every item in the given list.
-
On each evaluation, the temporary variable var will contain the value of the item under scrutiny. This function returns a list containing all of the items from the input list, for which expr evaluated true.  var will only be defined for the duration of expr, and will be undefined after the {[[MPI filter|filter]]} construct finishes.  If sep is given, then it uses that string as the item seperator in the input list, instead of the usual carriage return character.
+
On each evaluation, the temporary variable var will contain the value of the item under scrutiny. This function returns a list containing all of the items from the input list, for which expr evaluated true.  var will only be defined for the duration of expr, and will be undefined after the {[[filter (MPI)|filter]]} construct finishes.  If sep is given, then it uses that string as the item seperator in the input list, instead of the usual carriage return character.
If s2 is defined, then it will use that string to seperate the items in the list it returns, instead of the normal carriage return.  sep and s2 can be multiple characters long.
If s2 is defined, then it will use that string to seperate the items in the list it returns, instead of the normal carriage return.  sep and s2 can be multiple characters long.

Latest revision as of 04:35, 31 March 2007

filter

{filter:var,list,expr}
{filter:var,list,exp,sep}
{filter:var,lst,exp,sep,s2}

This evaluates expr for each and every item in the given list.

On each evaluation, the temporary variable var will contain the value of the item under scrutiny. This function returns a list containing all of the items from the input list, for which expr evaluated true. var will only be defined for the duration of expr, and will be undefined after the {filter} construct finishes. If sep is given, then it uses that string as the item seperator in the input list, instead of the usual carriage return character.

If s2 is defined, then it will use that string to seperate the items in the list it returns, instead of the normal carriage return. sep and s2 can be multiple characters long.

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox