You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, constraints validate some attributes of the input, e.g. that flags are provided a certain number of times, and so on. It would be nice to broaden the scope to ensure conditions that should hold across all provided inputs -- over multiple flags, for instance. Something like:
(constraint (> width height))
... which would ensure that the value received for the width flag is greater than that received for the height flag. The predicate here could be any function, so it could ensure arbitrary conditions on the provided flags -- conditions which could not be asserted within the handler functions for the individual flags.
Another thing is that since both flags as well as the core program are simply functions, it may be possible to leverage Racket's contract system to provide some guarantees. But since CLI scripts are unlikely to return values, and since the arguments and flags are already parsed from strings in each handler function, where appropriate errors may be raised, it seems doubtful that contracts can provide much additional value here.
The text was updated successfully, but these errors were encountered:
At the moment, constraints validate some attributes of the input, e.g. that flags are provided a certain number of times, and so on. It would be nice to broaden the scope to ensure conditions that should hold across all provided inputs -- over multiple flags, for instance. Something like:
... which would ensure that the value received for the width flag is greater than that received for the height flag. The predicate here could be any function, so it could ensure arbitrary conditions on the provided flags -- conditions which could not be asserted within the handler functions for the individual flags.
Another thing is that since both flags as well as the core program are simply functions, it may be possible to leverage Racket's contract system to provide some guarantees. But since CLI scripts are unlikely to return values, and since the arguments and flags are already parsed from strings in each handler function, where appropriate errors may be raised, it seems doubtful that contracts can provide much additional value here.
The text was updated successfully, but these errors were encountered: