# Command: forallindexed

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    forallindexed - Call a procedure for each element of a list/string

Synopsis:

      [v1,...,vn] {f} forallindexed ->  f(0,v1),...,f(n-1,vn)

Examples:

      [(a) (b)]  {} forallindexed -> (a) 0 (b) 1

Description:

      For each element of the input array, forallindexed calls f with
      two arguments, the element and its index within the list/string.
      forallindexed is similar to forall, only that the index of the
      element is also passed to the function f.

      Alternatives: Functions forallindexed_a for a list, forallindexed_s
      for a string (both undocumented) -> behaviour and synopsis are the same.

Parameters:

      [v1,...,vn]	- list of n arbitrary objects or string
      {f}		- function which can operate on the elements of the
      array. f is not required to return a specific number
      of values.

References:

    The Red Book

Author:

      Marc-Oliver Gewaltig

SeeAlso:

- Map
- MapIndexed
- Table
- forall
- NestList
- FoldList

Source:

    /opt/conda/conda-bld/nest_1510212701067/work/nest-2.14.0/sli/slicontrol.cc

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative