[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] read-byte, etc.
From: |
Hans Bulfone |
Subject: |
Re: [Chicken-users] read-byte, etc. |
Date: |
Mon, 3 Apr 2006 13:11:05 +0200 |
User-agent: |
Mutt/1.5.9i |
hi,
On Wed, Mar 29, 2006 at 07:06:40PM -0600, Alex Shinn wrote:
> 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.
thanks for your suggestion.
i would have also expected this version to be slightly
faster because read-char doesn't need to be looked up
on every invokation... but it got slightly slower;
can anybody explain why?
thanks,
hans.
- Re: [Chicken-users] read-byte, etc.,
Hans Bulfone <=
- Re: [Chicken-users] read-byte, etc., Alex Shinn, 2006/04/04
- Re: [Chicken-users] read-byte, etc., Hans Bulfone, 2006/04/06
- Re: [Chicken-users] read-byte, etc., F. Wittenberger, 2006/04/06
- Re: [Chicken-users] read-byte, etc., Alex Shinn, 2006/04/06
- Re: [Chicken-users] read-byte, etc., Benedikt Rosenau, 2006/04/07
- Re: [Chicken-users] read-byte, etc., felix winkelmann, 2006/04/10
- Re: [Chicken-users] read-byte, etc., Hans Bulfone, 2006/04/19
- Re: [Chicken-users] read-byte, etc., felix winkelmann, 2006/04/20