Created
June 28, 2017 01:23
-
-
Save mflatt/36b7f5f927b50460ea4369d83e5d56f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(with-output-to-file "testfile.ss" | |
(lambda () | |
(printf "(\n") | |
(let loop ([i 1000]) | |
(unless (zero? i) | |
(printf "x ") | |
(loop (sub1 i)))) | |
(printf ")\n")) | |
'truncate) | |
(define sfd | |
(let* ([ip (open-file-input-port "testfile.ss")] | |
[sfd (make-source-file-descriptor "testfile.ss" ip)]) | |
(close-port ip) | |
sfd)) | |
(parameterize (#;[current-make-source-object | |
(lambda (sfd bfp efp) | |
(make-source-object sfd bfp efp))]) | |
(call-with-input-file "testfile.ss" | |
(lambda (in) | |
(time | |
(let loop ([j 100000]) | |
(unless (zero? j) | |
(file-position in 0) | |
(get-datum/annotations in sfd 0) | |
(loop (sub1 j)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment