whalesong/sample-small-file-bytecode.rkt
2011-05-08 19:03:41 -04:00

14 lines
449 B
Racket

#lang racket
(require compiler/zo-parse)
(require (for-syntax racket/base))
(provide bytecode)
(define bytecode
(parameterize ([current-namespace (make-base-namespace)])
(let ([bc (compile (parameterize ([read-accept-reader #t])
(read (open-input-file "/home/dyoo/work/js-sicp-5-5/sample-small-file.rkt"))))]
[op (open-output-bytes)])
(write bc op)
(zo-parse (open-input-bytes (get-output-bytes op))))))