DalekBaldwin / check-it

Randomized specification-based testing for Common Lisp. Available through Quicklisp.
51 stars 10 forks source link

Allow standard lambda lists for defining def-generator parameters #14

Closed DalekBaldwin closed 9 years ago

DalekBaldwin commented 9 years ago

Right now all parameters to a custom generator are required, but optional parameters would be helpful -- they would allow something like the character generator to be reimplemented with def-generator.

transparent-wrap's parser assumes lamba lists have already been validated by the Lisp implementation, but def-generator lambda lists will need to be validated before the new generator type is constructed. It may be possible to save the lambda list form, build a do-nothing function with it, and then if Lisp doesn't signal an error while building that function, finally parse the saved lambda list with transparent-wrap's parser to get the variable/slot names. This would lead to style-warnings for unused arguments in the do-nothing function though.

So the right way to go is probably just to steal a good validating lambda list parser from somewhere else.