8.16.0.1
Andlet
(require andlet) | package: andlet |
1 Andlet
The provided forms allow one to combine the basic Racket and logic with let.
syntax
(andlet ([id val-expr #:test maybe-proc] ...) expr ...)
Like Racket’s let,
except the result of each expression val-exp in the (id val-exp) pairs is checked to be not #f. Any time a val-expr
evaluates to #f, the entire andlet expression is #f and subsequent bindings are not evaluated.
If a different condition than merely checking for falisty is required, use the optional argument #:test to give a procedure to use for generating the #t or #f value. Like Racket, anything which isn’t #f is considered #t.
Unlike Racket’s let, andlet is not capable of the named-let pattern of creating a procedure.
Example:
syntax
(andlet* ([id val-exp #:test maybe-proc] ...) expr ...)
Like andlet, except as with Racket’s let*, bindings are sequentially
introduced so subsequent val-exps may refer to the bound ids of
previous name/value pairs.
Example: