FunctionList:
Filter:
Classes | Core > Kernel

FunctionList : AbstractFunction : Object

A function that composes multiple functions into one

Description

A FunctionList is a function that composes multiple functions into one. This allows allow to deal transparently with several functions as if they were one and to append new functions at a later point. The functions are evaluated in the order they have in the FunctionList's array, which is by default the order in which they have been added to it.

See the Functions help file for a basic introduction.

Class Methods

FunctionList.new(functions)

create a new instance.

Arguments:

functions

An array of functions or objects

Inherited class methods

Instance Methods

.array

.array = value

Set/get the FunctionList's array. New functions can be added to the array directly, e.g.

.addFunc( ... functions)

This message is used to be able to add to an Object, to a Function, or to a FunctionList. nil.addFunc returns a function, if only one function is passed in the argument. function.addFunc then returns a FunctionList.

.removeFunc(function)

remove a function from the list.

Returns:

the last function when only one function is left, or nil when the last function was removed.

Discussion:

addFunc and removeFunc are implemented for Nil, Object and FunctionList

Inherited instance methods

Undocumented instance methods

.copy

.do(function)

.envirFlop

.flop

.flopped

.replaceFunc(find, replace)

.value( ... args)

.valueArray(args)

.valueArrayEnvir(args)

.valueEnvir( ... args)

Examples