Wiki

Changes between Version 3 and Version 4 of Contracts

Show
Ignore:
Timestamp:
08/24/10 03:46:58 (14 years ago)
Author:
Chuck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Contracts

    v3 v4  
    1616 
    1717== 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. 
     18Cobra 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. 
    1919 
    2020== Keywords ==