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
;; quoted-append | |
(define-syntax quoted-append | |
(syntax-rules () | |
((_)(append)) | |
((_ lis) | |
(append (quote lis))) | |
((_ lis1 lis2) | |
(append (quote lis1)(quote lis2))) | |
((_ lis1 lis2 ...) | |
(append (quote lis1)(quoted-append lis2 ...))))) | |
(quoted-append (1 2 3) (4 5) (+ x y)) | |
; -> (1 2 3 4 5 + x y) | |
(quoted-append (1 2 3)) | |
; -> (1 2 3) | |
(quoted-append (1 2 3)(+ 4 5)(+ 6 7 8)((lambda(x)(* x x)) 4) ) | |
; -> (1 2 3 + 4 5 + 6 7 8 (lambda (x) (* x x)) 4) | |
(quoted-append) | |
; -> () |
0 件のコメント:
コメントを投稿