Piccola / Interfaces / Label Index

Label

Standard Bindings

A label provides the following standard bindings:

returnsservicedescription
Formthis.bind(aForm)Returns a form containing the binding of this label to aForm.
Booleanthis.exists(aForm)Returns true if this label exists in aForm, returns false otherwise.
Stringthis.name()Returns a string representing the name of this label.
Formthis.project(aForm)Returns the projection of aForm to this label.
Formthis.restrict(aForm)Returns aForm without this label.
Booleanthis == aFormReturns true if this label is equal to aForm, false otherwise.
Booleanthis != aFormReturns true if this label is not equal to aForm, false otherwise.

JPiccola

In JPiccola, a label additionally provides the following bindings:

Formthis.hide(aForm)Returns aForm without this label.

Examples

label = newLabel("a")
form = label.bind("test")       # form == (a = "test")
label.exists(form)              # returns true
label.project(form)             # returns "test"
label.restrict(form)            # returns ()