From f84645ec2a79ebabf90e9a006b5958ef08bcde87 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 27 Sep 2006 19:11:45 +0000 Subject: [PATCH] added _bytes/eof svn: r4447 original commit: 6c2343f20cc5fdf43039308e1425b3584bb4f0d9 --- collects/mzlib/foreign.ss | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/collects/mzlib/foreign.ss b/collects/mzlib/foreign.ss index c402d16..ea8d54b 100644 --- a/collects/mzlib/foreign.ss +++ b/collects/mzlib/foreign.ss @@ -710,8 +710,12 @@ (lambda (x) (or x eof)))]) (hash-table-put! table string-type new-type) new-type)))))) -(provide _string/eof) -(define-syntax _string/eof +(provide _string/eof _bytes/eof) +(define _bytes/eof + (make-ctype string-type + (lambda (x) (and (not (eof-object? x)) x)) + (lambda (x) (or x eof)))) +(define-syntax _string/eof ; make it a syntax so it depends on the _string type (syntax-id-rules () [(_ . xs) ((string-type->string/eof-type _string) . xs)] [_ (string-type->string/eof-type _string)]))