Coming From /
Eiffel
Difference (last change) (no other diffs, normal page display)
Changed: 16c16,24
is apparently not easily possible to represent in D without support from the language/compiler itself. (The notation old(numberOfFoos) would mean the value of numberOfFoos at entry to the function insertFoo, as the equivalent notation in Eiffel does.) |
is apparently not easily possible to represent in D without support from the language/compiler itself. (The notation old(numberOfFoos) would mean the value of numberOfFoos at entry to the function insertFoo, as the equivalent notation in Eiffel does.) == Related = * Languages vs. D * ![]() * ![]() * ![]() * Language Specification * Development with D |
No "old" operator for function postconditions
Unfortunately D lacks Eiffel's "old" or any equivalent mechanism for the postcondition ("out") statements to refer to the original value which "this" had at the start of the function call.
Full Design By Contract includes a way to compare the object's values at the start and end of the function invocation, which is often necessary in order to define what the function does to the object.
( http://archive.eiffel.com/doc/manuals/technology/contract/ gives further discussion of this element of DBC.)
Thus something like
![]() |
|
Related
- Languages vs. D
D Transition Guide
Feature List
Rosetta Code: D category
- Language Specification
- Development with D