4.3 Functional Usage
The syntactic shorthand abbreviates the construction of formlets with the following library. These combinators may be used directly to construct low-level formlets, such as those for new INPUT element types. Refer to Predefined Formlets for example low-level formlets using these combinators.
content : any/c |
Equivalent to (-> integer? (values xexpr-forest/c (-> (listof binding?) (coerce-contract 'formlet/c content)) integer?)).
A formlet’s internal representation is a function from an initial input number to an X-expression forest rendering, a processing function, and the next allowable input number.
value : any/c |
Constructs a formlet that has no rendering and always returns value in the processing stage.
Constructs a formlet with a rendering equal to the concatenation of the renderings of formlets f and g; a processing stage that applies g’s processing result to f’s processing result.
Equivalent to cross lifted to many arguments.
(xml-forest r) → (formlet/c procedure?) |
r : xexpr-forest/c |
Constructs a formlet with the rendering r and the identity procedure as the processing step.
(xml r) → (formlet/c procedure?) |
r : xexpr? |
Equivalent to (xml-forest (list r)).
(text r) → (formlet/c procedure?) |
r : string? |
Equivalent to (xml r).
tag : symbol? |
Constructs a formlet with the rendering (list (list* tag attrs inner-rendering)) where inner-rendering is the rendering of inner and the processing stage identical to inner.
Renders f.
(formlet-process f r) → any/c |
r : request? |
Runs the processing stage of f on the bindings in r.