- One should not need to state the function name in every error call.
It must be available somewhere for the error handling to read straight out. Not only would this save memory, it would also save us from having alarm() say "Too few arguments to signame()". Having the error handling take care of this also ensures that the name of the failing function is printed out at all.
Unfortunately, it is quite common that the canonical name and the "real" name are different. I would much rather the error message said wrong number of arguments to Image.JPEG.decode than _Image_JPEG.decode (Not sure if this particular example is correct, but you get the point..)
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-01-04 21:20: Subject: Too many arguments
Just grep for wrong_number_of_args and you'll get 334 matches, so I'll guess there's around 332 functions that throws when you give them more arguments than they need. With built in I really meant C functions.
I can give a little background to this exploration as well. I looked at the strings in the Pike binary and found that there was a great number of similar looking error messages ("Bad argument 2 to exece()", "Bad argument 1 to exece()", "Bad argument 1 to mv()" etc). Rewriting into using SIMPLE_TOO_FEW_ARGS_ERROR and SIMPLE_BAD_ARG_ERROR helps a lot, but it should be possible to do a lot better.
- These are macros that expands to verbose function call. A special
function for this very common task might be good. 2. One should not need to state the function name in every error call. It must be available somewhere for the error handling to read straight out. Not only would this save memory, it would also save us from having alarm() say "Too few arguments to signame()". Having the error handling take care of this also ensures that the name of the failing function is printed out at all. 3. One should not need to state the correct type for an argument in a string. All the correct types should already be known and be available for the error handling to read and use.
I know too little about Pike internals and C to solve these (at least 2 and 3) though.
/ Martin Nilsson (bygger parser