Welcome to the CHICKEN Scheme pasting service

do added by megane on Thu Aug 8 13:22:18 2019

(define (>>= m f) (f m))

(define-syntax dodo
  (syntax-rules (<-)
    ((_ exp) exp)
    ((_ var <- exp r ...) (>>= exp (lambda (var) (dodo r ...))))
    ((_ exp r ...) (>>= exp (lambda (_) (dodo r ...))))))

(dodo
 a <- (add1 0)
 (print "a: " a)
 b <- (add1 a)
 (print (list a b)))

;; $ csi -qbn do-syntax.scm 
;; a: 1
;; (1 2)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
                _               _       
 ______  ____ _| |__   __ _  __| | __ _ 
|_  /\ \/ / _` | '_ \ / _` |/ _` |/ _` |
 / /  >  < (_| | |_) | (_| | (_| | (_| |
/___|/_/\_\__,_|_.__/ \__,_|\__,_|\__, |
                                     |_|
Visually impaired? Let me spell it for you (wav file) download WAV