[Top][All Lists]

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

Re: Likely a good frog project for someone with C knowledge

From: David Kastrup
Subject: Re: Likely a good frog project for someone with C knowledge
Date: Tue, 16 Aug 2011 23:55:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Reinhold Kainhofer <address@hidden> writes:

> However, I'm not sure if this will really work out or give us much benefit. 
> In particular, we have lots of checks for == SCM_EOL or == SCM_BOOL_T. E.g. 
> very deep inside the core of lilypond:
> inline bool ly_cheap_is_list (SCM x) {return scm_is_pair (x) || x==SCM_EOL; }
> Is this really not allowed?

The Guile documentation is unambiguous about that: it is not allowed.

Guile has scm_is_null which is a macro expanding to the direct
comparison with SCM_EOL if the type debugging is switched off, and to
something that works and compiles if it is on.

I have hit several type bugs (Scheme/integer confusions) so far while
looking randomly for the source of my segmentation fault.  If we can get
the source into a state where the compiler can help with the work of
flagging them, that's an advantage.

And I don't think it a good idea to rely on explicitly undefined
behavior of Guile.

David Kastrup

reply via email to

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