guile-devel
[Top][All Lists]
Advanced

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

Re: scm_out_of_range_pos()


From: Martin Baulig
Subject: Re: scm_out_of_range_pos()
Date: 02 Sep 2001 17:36:19 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Dirk Herrmann <address@hidden> writes:

> On 1 Sep 2001, Martin Baulig wrote:
> 
> > is there any reason why there's both scm_out_of_range() and
> > scm_out_of_range_pos() instead of checking whether pos != 0 like
> > in scm_wrong_type_arg() ?
> 
> The question could as well go the other way around:  Why is 0 a magic
> number, that indicates an unknown parameter position?  IMO, in a lot of
> places where there is made use of the 0=unknown trick, proper argument
> numbers could be given.  A typical example are those functions, which take
> a rest argument and simply don't bother to count which argument they are
> currently checking.  In these functions, an argument position of 0 is
> given.  This is not very user friendly.
> 
> The first attempt should be made at removing most of those places where a
> 0 parameter is given.  Second, we should revise the set of error
> signalling functions to be more consistent.

Well, I was using this to check the return value of a scm_apply() (of a scheme
function which is private to my module and has a guaranteed return type), but
I guess I should use a better error message anyways.


-- 
Martin Baulig
address@hidden (private)
address@hidden (work)



reply via email to

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