[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] sdl.egg v0.2

From: Tony Garnock-Jones
Subject: Re: [Chicken-users] sdl.egg v0.2
Date: Wed, 03 Nov 2004 11:47:28 +0000
User-agent: Mozilla Thunderbird 0.8 (Macintosh/20040913)

Alex Shinn wrote:
Yes, this is great!  It's now compatible with a lot of my existing SDL
code :)


Your definition of sdl-with-clip-rect uses the wrong procedure names
though, it should be

<slaps forehead> Doh! Sorry about that. I'll post a corrected version shortly.

I agree with you that using numbers for flags instead of symbols is
simpler and makes more sense for tight C integeration.  However, in
the README you should probably recommend using bitwise-ior for joining
flags rather than +, since a common idiom is

Yes, I started off doing that myself, but ran into problems with flags that do not fit in immediate small integers. I've just written a paragraph for the README which I hope explains the situation:

"The reason I am recommending (+) over (bitwise-ior) here is that some
of the flags do not fit in an immediate small integer, and must be
represented as inexact numbers. Unfortunately, bitwise-ior only works
properly when applied to immediate small integers, so there is a
tradeoff to be made: use (bitwise-ior) where you are *sure* all the
flags will fit in immediate integers, and use (+) otherwise, bearing
in mind the fact that (bitwise-ior) gives an answer much more in the
spirit of a bit set definition: if a flag is already set,
(bitwise-ior) will not set it twice, where (+) will happily screw up
the result completely."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]