Handbook
Glossary
v-optional ( str quot -- result )
Form validators
Prev:
v-default ( str def -- str/def )
Next:
v-min-length ( str n -- str )
Vocabulary
validators
Inputs
str
a
string
quot
a
quotation
Outputs
result
a
string
Word description
If the string is non-empty, applies the quotation to the string, otherwise outputs the empty string.
Definition
USING:
kernel
sequences
;
IN:
validators
:
v-optional
( str quot -- result )
over
empty?
[
2drop
f
]
[
call
]
if
;
inline