こうかなー。
This file contains 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
;; On Lisp --- 汎変数 http://www.komaba.utmc.or.jp/~flatline/onlispjhtml/generalizedVariables.html | |
(use srfi-17) | |
(define-syntax allf | |
(syntax-rules () | |
((_ val arg1 arg2 ...) | |
(let ((v val)) | |
(set! arg1 v) | |
(set! arg2 v)...)))) | |
(let ((prints (lambda args | |
(for-each print args)))) | |
(let/ #f (a b c d) | |
(prints a b c d) | |
(allf #t a b c d) | |
(prints a b c d))) | |
;; #f | |
;; #f | |
;; #f | |
;; #f | |
;; #t | |
;; #t | |
;; #t | |
;; #t | |
;; #<undef> |
0 件のコメント:
コメントを投稿