Guest User

Untitled

a guest
May 26th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ;; implecations
  2.  
  3. (define-syntax implecations
  4. (syntax-rules (=>)
  5. ((_ (pred => body ...) ...)
  6. (begin
  7. (when pred
  8. body ...)
  9. ...))))
  10.  
  11. (let ((x 0)(y 0)(hoge "hello")(false #f))
  12. (implecations ((zero? x) => (display x)(newline))
  13. ((number? y) => (format #t "~a is number." y))
  14. (false => (print hoge))
  15. (#t => (print "world !"))))
  16. ;; 0
  17. ;; 0 is number.world !
  18. ;; #<undef>
Add Comment
Please, Sign In to add comment