At Thu, 30 Mar 2006 02:42:36 +0200, Hans Bulfone wrote: > > i'm porting the rfc.mime library from gauche to chicken. > > in the library the procedures read-byte, peek-byte and > write-byte are used to read/write bytes which are given > as integers. > > at the moment, i'm using > > (define (read-byte . args) > (let ((ch (apply read-char args))) > (if (eof-object? ch) > ch > (char->integer ch)))) > > and similar definitions which seem to work, but i wonder > if they are still correct with the utf8 egg.
The utf8 egg is a syntax-case module, so even if some other module is using it, your code will see the original READ-CHAR. People can (import utf8) into the top-level if they want, but this isn't always guaranteed to play well with other people's code. If you want to guard against this you can: (define read-byte (let ((read-char read-char)) (lambda args (let ((ch (apply read-char args))) (if (eof-object? ch) ch (char->integer ch)))))) which will do the right thing no matter what. -- Alex _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users