diff --git a/src/ikarus.boot b/src/ikarus.boot index 6bbf754..e8b18f8 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/libfasl.ss b/src/libfasl.ss index a0eb120..b3791e5 100644 --- a/src/libfasl.ss +++ b/src/libfasl.ss @@ -226,3 +226,21 @@ (error 'fasl-write "~s is not an output port" port)) (do-fasl-write x port)]))) + +(let () + (define who 'fasl-read) + (define (assert-eq? x y) + (unless (eq? x y) + (error who "Expected ~s, got ~s\n" y x))) + (define (do-read p) + (let ([h (read-char p)]) + (case h + [else + (error who "Unexpected ~s as a fasl object header" h)]))) + (primitive-set! '$fasl-read + (lambda (p) + (assert-eq? (read-char p) #\I) + (assert-eq? (read-char p) #\K) + (assert-eq? (read-char p) #\0) + (assert-eq? (read-char p) #\1) + (do-read p)))) diff --git a/src/libtokenizer.ss b/src/libtokenizer.ss index 35b42d2..3525198 100644 --- a/src/libtokenizer.ss +++ b/src/libtokenizer.ss @@ -405,6 +405,8 @@ [else (error 'tokenize "invalid char ~a inside gensym" c)])))]))] + [($char= #\@ c) + (cons 'datum ($fasl-read p))] [else (unread-char c p) (error 'tokenize "invalid syntax #~a" c)]))) diff --git a/src/makefile.ss b/src/makefile.ss index dc25fe2..ad77e78 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -115,6 +115,7 @@ trace-symbol! untrace-symbol! make-traced-procedure fixnum->string $interrupted? $unset-interrupted! $do-event + $fasl-read ;;; TODO: must open-code $make-port/input $make-port/output $make-port/both