;http://groups.google.com/group/comp.lang.functional/msg/2fde5545c6657c81 (define-syntax do (syntax-rules (def) ((do (v <- expr) rest) (bind expr (lambda (v) rest))) ((do expr) expr) ((do expr expr) (bind (set expr) (lambda (dummy) expr))) ((do expr expr* ...) (do expr (do expr* ...))))) This emulates Haskell's do-notation, which we can use as follows: (define (number-tree tree) (if (pair? tree) (do (left-subtree <- (number-tree (car tree))) (right-subtree <- (number-tree (cdr tree))) (unit (cons left-subtree right-subtree))) (do (n <- get) (set (+ n 1)) (unit n)))) Cool, huh?