anaphoric/and-let.rkt
Georges Dupéron 4bb11cb8f6 Add aand
2018-01-27 12:04:17 +01:00

16 lines
329 B
Racket

#lang racket/base
(provide and-let)
(require syntax/parse/define
anaphoric/if-let
(for-syntax racket/base))
(define-syntax and-let
(syntax-parser
[(_) #'#true]
[(_ body:expr) #'body]
[(_ [variable:id condition:expr] rest ...+)
#'(if-let [variable condition] (and-let rest ...) #false)]))