This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

guile bugs


Jim Blandy <jimb@red-bean.com> writes:

> > Any guile person want to remind me why SCM_BOOL_F was not made to be 0?
> > I know the tagging scheme is complex, but I'd certainly design it so
> > that I could have 0 be #f.
> 
> So that pointers can be used directly, for speed.  Probably not a good
> argument; if you subtract off the tag, that'll get added into whatever
> offset you're using to fetch a structure element...

Hmmm... yea, it sure would've saved a lot of bugs in Scwm (especially
early on) if Scheme booleans could be treated as C booleans.  I
hypothesize that three changes would find a ton of bugs in Guile and Scwm:

1) SCM_BOOL_F should be 0 so it is false in C

2) SCM should not be a long, but instead be a pointer to undefined
struct as we discussed before.  This would prevent misuse of an integer
as a Scheme value.

3) The checking of the argument numbers using a more sophisticated macro 
like SCWM_PROC and Scwm's documentation extraction system (as mentioned
in an email earlier this week).

These are all pretty pervasive changes, unfortunately, but I'm guessing
they'd be a huge win in the long run.

Greg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]