-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add assertion functionality for pre/post conditions. #12
Comments
Obviously that's not quite right... it would need to be a macro to disappear on compilation, but that's the general idea. I'd be happy to work on it if this functionality is desirable. Also, do we still need to return a list for each key? The short-circuiting means only one error is returned for each key. |
And now I think this is probably a bad idea. Assertion methods should return nil (as this does), but then it is not suitable for use in a pre/post conditions. This would just be a utility method to stick in code during debugging, but then the needs are just as easily met by |
Sorry about the delay. I'll have a think about this and come back to you. Regarding returning lists, that's there for backwards compatibility - the short-circuiting mechanism hasn't always been there. |
Hi @ToBeReplaced , I think this feature should probably be left out of the core functionality and into the user code. It seems to be mostly concerned with control flow and error presentation. For that reason, I'm closing this issues. Feel free to re-open it if you think you have better arguments as to why this should be in the core lib. Thanks |
What would you think about adding functionality like:
This would be useful in
:pre
and:post
conditions instead ofvalid?
, sincevalid?
gives no visibility into how/why it returned false.The text was updated successfully, but these errors were encountered: