This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Suggestion: SCM_DEBUG_REST_ARGUMENTS (fwd)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]