Skip to content
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

make it easy to switch different assertions on and off #7

Open
sellout opened this issue Apr 26, 2011 · 1 comment
Open

make it easy to switch different assertions on and off #7

sellout opened this issue Apr 26, 2011 · 1 comment

Comments

@sellout
Copy link
Owner

sellout commented Apr 26, 2011

It's common to want to turn off postcondition (and maybe invariant) checks for third-party libraries. It should be easy for developers to control what is enabled on a per-package or per-asdf-system basis. Creating WITH-CONTRACTS-ENABLED to use around LOAD and adding in hooks to make it easy to use with ASDF.

We also have to make it easy to use big switches, to distinguish in-development from production, and any other arbitrary situations the developer may want different handling for.

@sellout
Copy link
Owner Author

sellout commented Apr 27, 2011

As of b276916, you can now wrap arbitrary code in WITH-CONTRACTS-ENABLED or -DISABLED.

(with-contracts-disabled ()
  (asdf:load-system :some-system))

will disable contracts for all classes and functions in that system. And

(with-contracts-disabled ()
  (some-contracted-method ...)
  ...)

will disable them for any calls that happen within.

However, I think the semantics of what is disabled when are probably a bit off, and there's still no way to control this at the system or application level, so there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant