Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » apply » apply(Thing,Function)
next | previous | forward | backward | up | index | toc

apply(Thing,Function) -- apply a function to an object with an iterator

Description

Suppose x is an instance of a class with the iterator method installed and suppose iter is the output of iterator x. Then a new Iterator object is returned whose next method returns f next iter until next iter returns StopIteration, in which case this new iterator does the same.

i1 : applyiter = apply(iterator "foo", toUpper)

o1 = applyiter

o1 : Iterator
i2 : next applyiter

o2 = F
i3 : next applyiter

o3 = O
i4 : next applyiter

o4 = O
i5 : next applyiter

o5 = StopIteration

o5 : Symbol

See also

Ways to use this method:


The source of this document is in Macaulay2Doc/functions/apply-doc.m2:126:0.