Advertisement
Jobjob

Programmation déclarative - Q2C - 06/2012

Jan 4th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.37 KB | None | 0 0
  1. (require (lib "defmacro.ss"))
  2.  
  3. (define-macro (do2 test . body)
  4.   `(letrec ((loop (lambda ()
  5.                     (begin ,@body
  6.                            (if ,test
  7.                                (void)
  8.                                (loop)
  9.                                )
  10.                            )
  11.                     )
  12.                   ))
  13.      (loop)
  14.      ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement