Created
January 20, 2011 07:41
-
-
Save masahitojp/787539 to your computer and use it in GitHub Desktop.
初めてのマクロ(unless)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; unless macro | |
(define-syntax unless | |
(syntax-rules () | |
((_ pred b1 ...) | |
(if (not pred) (begin b1 ...))))) | |
; 動作テスト | |
(let ((i 0)) | |
(unless (= i 1) | |
(display "i != 0") | |
(newline))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment