;(let* ((yin ((lambda (foo) (display "@") foo) (call/cc (lambda (bar) bar))))
; (yang ((lambda (foo) (display "*") foo) (call/cc (lambda (bar) bar)))))
; (yin yang))
;;;阴阳迷题的原始代码
(define bar (lambda (bar) bar))
(define foox (lambda (foo) (display "@") foo))
(define fooy (lambda (foo) (display "*") foo))
;(let* ((yin (foox (call/cc bar)))
; (yang (fooy (call/cc bar))))
; (yin yang))
;;;第一次简化后的代码
;(let ((yin (foox (call/cc bar))))
; (let ((yang (fooy (call/cc bar))))
; (yin yang)))
;;;第二次简化后的代码
((foox (call/cc bar)) (fooy (call/cc bar)))
;;;最后去掉let的代码
没有评论:
发表评论