inum - luxembourg/muxcode-clm GitHub Wiki

INUM()

FUNCTION: itext(<n>) inum(<n>) ilev()

These functions, when called within an iter() or parse(), return the equivalent of ## (itext) or #@ (inum), with reference to the nth more outermost iter(), where n=0 refers to the current iter(), n=1 to an iter() in which the current iter() is nested, etc.

Unlike the ## and #@ substitutions which are substituted in the evaluation string before it is evaluated, itext(), inum(), and ilev() substitute their values as part of evaluation. In this way, the use of these functions is safer than the ## and #@ substitutions and is therefore preferred.

> say [iter(red blue green,iter(fish shoe, #@:##))] You say, "1:red 1:red 2:blue 2:blue 3:green 3:green"

> say [iter(red blue green,iter(fish shoe, [inum(1)]:[itext(1)]))] You say, "1:red 1:red 2:blue 2:blue 3:green 3:green"

> say [iter(red blue green,iter(fish shoe, [inum(0)]:[itext(0)]))] You say, "1:fish 2:shoe 1:fish 2:shoe 1:fish 2:shoe"

> say [iter(red blue green,iter(fish shoe, [itext(1)]:[itext(0)]))] You say, "red:fish red:shoe blue:fish blue:shoe green:fish green:shoe"

Related Topics: iter, ilev, itext