[Top][All Lists]

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

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

From: Dirk Herrmann
Subject: Re: GH replacement proposal (includes a bit of Unicode)
Date: Thu, 22 Apr 2004 19:48:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821

Rob Browning wrote:

Dirk Herrmann <address@hidden> writes:

Alternative 1:
* change the functions in the following way:
 <type> scm_to_<type> (SCM value, int *success)
 Instead of signalling an error, *success indicates whether the value
can be represented. If *success is 0, the returned value is
unspecified. If success is NULL, an error is signalled for the case
that the value can not be represented.
Thus, I would prefer either alternative 1 or 2, favoring alternative 1.

I had the same concern, and offhand, think I'd probably prefer 1 as well.

Thinking more about it, I would even go further and simply disallow the passing of NULL. It's just another asymmetry and magic number. The rule woule be, that (if the SCM argument is of the correct type), the caller always has to provide a valid pointer for success. On the contrary, if the SCM argument is not of the correct type, an error should be thrown. The success argument is therefore only for overflow checks, not for type checks. This is symmetric with the other conversion functions.

Best regards

reply via email to

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