2007-09-28から1日間の記事一覧
(local ((define (f . x) (print x)) (f 1 2 3)) みたいのがうまくいかない.ま,いっか.
(define-macro (local defs . body) (let* ((split-define (lambda (def) (let ((name (cadr def)) (body (cddr def))) (if (list? name) (cons (car name) (list (cons 'lambda (cons (cdr name) body)))) (cons name body))))) (def-pairs (map split-defi…
大嘘だったので削除.ブラウザの履歴から復元できました.Dr.Schemeにはlocalという構文がある. (local ((define x 1)) (+ x 1)) などとして使って,xがローカル変数になって外部からは見えなくなる,というもの.これは当然,R5RSには無い構文で,Dr.Schem…