This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Suggestion: SCM_DEBUG_REST_ARGUMENTS (fwd)
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Re: Suggestion: SCM_DEBUG_REST_ARGUMENTS (fwd)
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Wed, 17 May 2000 01:04:59 +0200 (MEST)
On 16 May 2000, Jost Boekemeier wrote:
(in private mail, but with permission to forward)
> Functions which are local to the evaluator don't have to check their
> arguments but *all* functions reachable by user code must check their
> arguments. I don't think that functions which are both local to the
> evaluator and callable by user code do exist.
Example: scm_append
If you call this from scheme via
(append ...)
then the evaluator will create the list of rest arguments for us. Thus,
it is guaranteed that the rest arguments actually form a list.
If you call this from C via
...
SCM result = scm_append (args);
...
then the user has to guarantee, that 'args' is a list, namely the list of
rest arguments. If that code is broken, it may be that 'args' is not a
proper list.
Thus, should scm_append always have to check whether 'args' is actually a
proper list, just because broken user calls from the C level might provide
stupid parameters?
Best regards
Dirk