guile-devel
[Top][All Lists]
Advanced

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

scm_wrong_num_args


From: Dirk Herrmann
Subject: scm_wrong_num_args
Date: Tue, 6 Mar 2001 11:28:19 +0100 (MET)

Hello list,

I suggest to change the function scm_wrong_num_args to take two
parameters:  a const char* indicating the function where the lack of the
parameters was detected, and a SCM value indicating the function object
that was to be applied (or #f if none).

There are two reasons for this:  The first is, that currently the error
message is not too helpful:

guile> (make-string)   
<unnamed port>:3:1: In procedure make-string in expression (make-string):
<unnamed port>:3:1: Wrong number of arguments to #<primitive-procedure 
make-string>
ABORT: (wrong-number-of-args)

Actually, the error was detected in the evaluatur, and not in procedure
make-string.  Another example can be found in hooks.c in function
run-hook, where currently a misc error is thrown if the number of
arguments does not match.  Again, a better error was a wrong-num-args
error, indicating that the error was detected in run-hook and the wrong
number of args was given to the hook object.

The second reason is about symmetry, because all other error reporting
functions take a const char* indicating the origin of the error.

Please tell me if this incompatible change will be OK.

Best regards,
Dirk Herrmann




reply via email to

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