guile-devel
[Top][All Lists]
Advanced

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

Re: GH replacement proposal (includes a bit of Unicode)


From: Paul Jarc
Subject: Re: GH replacement proposal (includes a bit of Unicode)
Date: Wed, 21 Apr 2004 17:46:32 -0400
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

Marius Vollmer <address@hidden> wrote:
> Is there an advantage of having instead
>
>  scm_to_bool   --- return 0 for #f, 1 for #t, else signal error

It would be more symmetric, as I suggested earlier.

A procedure argument might have defined meanings for #f and #t, and
later it might be extended with defined meanings for other values.
Now suppose a new caller passes 42, expecting the new extended
semantics, but it happens to be calling an old version of the
procedure which only supports boolean values.  Having a scm_to_bool
which signals an error here would help detect this problem early.

> What about
>
>  scm_from_bool --- return #f for 0, #t for 1, else signal error

I think 1 in C is sufficiently less distinctive than #t in Scheme that
this would not be good.


paul




reply via email to

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