rackunit icon indicating copy to clipboard operation
rackunit copied to clipboard

Support keyword, rest, and default arguments in custom checks

Open jackfirth opened this issue 9 years ago • 2 comments

define-check and define-simple-check only allow positional arguments without defaults to be provided. If checks are meant to be semantically procedures, they should accept the same arguments as procedures.

jackfirth avatar Jul 28 '16 01:07 jackfirth

Rest args would be problematic, because define-check adds an extra optional positional argument message. So (define-check (f x y) ....) defines f as a "procedure" of 2 or 3 arguments.

We could add a check definition form that didn't do that, though.

rmculpepper avatar Jul 29 '16 16:07 rmculpepper

Never knew that, the docs ought to mention it. I don't find it too useful though because with custom checks I'm always constructing the error message within the check, but this param just adds something to the info stack. Is that behavior used?

jackfirth avatar Jul 29 '16 16:07 jackfirth