procedure-arity-mask hard to use for error reporting Per Bothner (15 Apr 2020 00:22 UTC)

procedure-arity-mask hard to use for error reporting Per Bothner 15 Apr 2020 00:22 UTC

A problem with procedure-arity-mask is that it is not very helpful for reporting errors.

For example, in Kawa:

#|kawa:1|# (define (foo x #!optional y z) (list x y z))
#|kawa:2|# (foo 3 4 5 6)
/dev/tty:2:1: call to 'foo' has too many arguments (4; min=1, max=3)

Extracting min and max from a bit-mask is awkward.  It would be helpful
to at least have some helper procedure to extract min and max (or #f) from the bit-mask.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/