Last active
December 17, 2015 00:19
-
-
Save yamasushi/5519760 to your computer and use it in GitHub Desktop.
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
>gosh /home/shuji/gauche/debug/test.scm | |
#?="/home/shuji/gauche/debug/test2.scm":23:(rp-dict) | |
#?- #<hash-table eq? 0x99230f0> | |
#?="/home/shuji/gauche/debug/test2.scm":11:(rp-dict) | |
#?- #<hash-table eq? 0x99230f0> | |
(1)#?="/home/shuji/gauche/debug/test2.scm":13:(rp-dict) | |
#?- #f | |
*** ERROR: (rp-dict) is false | |
Stack Trace: | |
_______________________________________ | |
0 (scan-shared obj 0 0) | |
At line 24 of "/home/shuji/gauche/debug/test2.scm" |
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
(use debug.test2) | |
(use gauche.generator) | |
(use gauche.lazy) | |
($ tt | |
$ generator->lseq | |
$ (cut gtake <> 10) | |
$ generate (^y (y 1)) ) |
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
(define-module debug.test2 | |
(use gauche.parameter) | |
(export tt) | |
) | |
(select-module debug.test2) | |
(define rp-dict (make-parameter #f)) ;table to count shared structure | |
(define simple-obj---? identity) | |
(define (simple-obj? x) | |
#?=(rp-dict) | |
(write x) (flush) | |
#?=(rp-dict) | |
(member x '("") ) ) | |
(define (scan-shared obj level len) | |
(rp-dict) | |
(cond [(simple-obj? obj) #f] | |
[else (unless (rp-dict) (error "(rp-dict) is false") ) ])) | |
(define (tt obj) | |
(parameterize ( [rp-dict (make-hash-table 'eq?)] ) | |
#?=(rp-dict) | |
(scan-shared obj 0 0) ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment