Multiple dispatch. Maybe you can create a hash signature for each combination of arguments. Then req becomes a hash set or a dict depending on your design.
- Efficient way to validate function arguments drkameleon
- Re: Efficient way to validate function arguments foldl