Gauche:部分継続と動的環境の実験

Gauche:部分継続と動的環境の実験

成果物

現状の最新の成果物は、以下の通りです。

部分継続と動的環境の学習の起点としては、下記の参考情報の [文献A] がお勧めです。

hamayama(2019/10/15 14:07:52 UTC)


気になる例2 (dynamic-wind の before 内に shift があるケース)

(require racket/control)      ; for Racket
;(use-modules (ice-9 control)) ; for Guile
;(use gauche.partcont)         ; for Gauche
(define k1 #f)
(define k2 #f)
(reset
 (dynamic-wind
  (lambda () (display "[d01]")
             (shift k (set! k1 k))
             (display "[+s01+]"))
  (lambda () (display "[d02]")
             (shift k (set! k2 k))
             (display "[*s02*]"))
  (lambda () (display "[d03]"))))
;; ==> [d01]
(k1)
;; ==> [+s01+][d02][d03]
(k2)
;; ==> [d01]
(k2)
;; ==> [d01]
(k1)
;; ==> [+s01+][*s02*][d03]

hamayama(2019/09/04 13:06:12 UTC)


気になる例1 (shift の中に shift があるケース)

(require racket/control)      ; for Racket
;(use-modules (ice-9 control)) ; for Guile
;(use gauche.partcont)         ; for Gauche
(define k1 #f)
(define k2 #f)
(reset
 (dynamic-wind
  (lambda () (display "[d01]"))
  (lambda ()
    (reset
     (dynamic-wind
      (lambda () (display "[d11]"))
      (lambda ()
        (shift k (set! k1 k)
                 (display "[s01]")
                 (shift k (set! k2 k)
                          (display "[s02]"))
                 (display "[s03]")
                 1000)
        (display "[s04]"))
      (lambda () (display "[d12]")))
     2000))
  (lambda () (display "[d02]")))
  3000)
;; ==> [d01][d11][d12][s01][s02][d02]3000
(k1)
;; ==> [d11][s04][d12]2000
(k2)
;; ==> [s03]1000

hamayama(2019/09/01 11:00:49 UTC)(2019/09/05 00:50:40 UTC)


dynamic-test v4

hamayama(2019/08/29 09:03:35 UTC)(2019/08/29 20:05:41 UTC)
(2019/08/31 09:11:49 UTC)


dynamic-test v3 (broken) (没)

(define (leak-test1 identity-thunk)
  (let loop ((id (lambda (x) x)))
    (loop (id (identity-thunk)))))
(leak-test1 (lambda () (emu-reset (emu-shift k k))))

hamayama(2019/08/12 07:06:14 UTC)(2019/08/12 11:17:16 UTC)
(2019/08/13 01:41:09 UTC)(2019/08/13 12:52:35 UTC)


dynamic-test v1 (broken) (没)

hamayama(2019/07/15 15:42:40 UTC)


Gauche-effects

https://github.com/Hamayama/Gauche-effects

hamayama(2019/08/17 11:29:19 UTC)(2019/08/29 09:03:35 UTC)


参考情報

hamayama(2019/08/22 13:31:07 UTC)(2019/10/15 12:07:11 UTC)

More ...