Changes between Version 3 and Version 4 of Contracts
- Timestamp:
- 08/24/10 03:46:58 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Contracts
v3 v4 16 16 17 17 == Boolean Expressions == 18 Be aware that Cobra gives '''and''', '''or''', and '''implies''' equal precedence which is different from the conventions of boolean logic and most other languages including C# and Python. Since boolean expressions are the basis of contracts you should be aware of the implications to your expressions when writing your preconditions, postconditions and invariants, specifically that additional parentheses will be required where you might not expect to need them.18 Cobra gives '''and''' and '''or''' equal precedence, therefore requiring explicit parentheses for expressions that use both operators but need an order of evaluation other than simple left to right. This is in contrast to boolean logic notation and most other programming languages, so bear this in mind when writing your preconditions, postconditions and invariants. 19 19 20 20 == Keywords ==