[Type] Control
Part of: mobl
Inherits from: mobl::Object
Represents controls, enabling passing controls as values.
There is a range of types, depending on the number of arguments a control has, e.g.
control ctrl1() { } // -> type: Control
control ctrl2(n : Num) { } // -> type: Control1<Num>
control ctrl3(n1 : Num, n2 : Num) { }
// -> type: Control2<Num,Num>
Variables/parameters of type ControlX
can be instantiated as any control call.
Example:
control showName(t : Task) {
label(t.name)
}
control forEach(ts : Collection<Task>,
ctrl : Control1<Task>) {
list(t : Task in ts) {
ctrl(t)
}
}
screen root() {
forEach(ts, showName)
}
mobl/control.txt · Last modified: 2013/10/01 02:28 (external edit)