This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: guile bugs
- To: Jim Blandy <jimb AT red-bean dot com>
- Subject: Re: guile bugs
- From: Dirk Herrmann <dirk AT ida.ing.tu-bs.de>
- Date: Thu, 16 Sep 1999 17:26:49 +0200 (MEST)
- cc: Greg Badros <gjb AT cs.washington dot edu>, Jay Belanger <jay AT vh213601.truman dot edu>, scwm-discuss AT scwm.mit dot edu, guile AT sourceware.cygnus dot com
On 16 Sep 1999, Jim Blandy wrote:
> > 1) SCM_BOOL_F should be 0 so it is false in C
>
> If someone were to make this change and show me before and after
> benchmark results (see guile-modules/benchmarks), then that would help
> persuade me.
I think this should not be done, independent of any benchmark results.
The main reason for this change would be to make sure that SCM_BOOL_F is
not accidentally used as a boolean value. If, instead, it would be
possible to guarantee that using a SCM value as a boolean value will lead
to a compile time error, everything is fine.
If I understand correctly from some previous mail, defining SCM as a
union would serve that purpose.
> > 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.
>
> I'd love to see this change happen.
If such a change is done, it might be done in a way that would let guile
compile independent of whether SCM is defined either as a union or as a
pointer to an undefined struct.
Then, we could have something like a "find compile time error"-mode by
defining SCM as a union. This would only be used for developers, since it
would lead to performance penalties. In all other cases, SCM would just
be defined as a pointer to an undefined struct.
example:
#ifdef FIND_COMPILE_TIME_ERROR_MODE
[define SCM as a union]
#else
[define SCM as a pointer to an undefined struct]
#endif
This way, 1) would become unnecessary. However, it possibly requires more
effort when doing 2). Still, even 2) will introduce an awful lot of
casting.
Best regards,
Dirk Herrmann