Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. (with-output-to-file "testfile.ss"
  2. (lambda ()
  3. (printf "(\n")
  4. (let loop ([i 1000])
  5. (unless (zero? i)
  6. (printf "x ")
  7. (loop (sub1 i))))
  8. (printf ")\n"))
  9. 'truncate)
  10.  
  11. (define sfd
  12. (let* ([ip (open-file-input-port "testfile.ss")]
  13. [sfd (make-source-file-descriptor "testfile.ss" ip)])
  14. (close-port ip)
  15. sfd))
  16.  
  17. (parameterize (#;[current-make-source-object
  18. (lambda (sfd bfp efp)
  19. (make-source-object sfd bfp efp))])
  20. (call-with-input-file "testfile.ss"
  21. (lambda (in)
  22. (time
  23. (let loop ([j 100000])
  24. (unless (zero? j)
  25. (file-position in 0)
  26. (get-datum/annotations in sfd 0)
  27. (loop (sub1 j))))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement