Is there a facility in Cobra that would allow me, when moving from development to production, to generate code that contains preconditions but not postconditions or invariants?
Let me know and best regards as always,
Steve
--
Forums
DbC Control
3 posts
• Page 1 of 1
Re: DbC Control
At compile-time, you can turn them off completely with -contracts:none
At run-time, you can turn off checks like so:
.willCheckNil affects (1) checking that parameters with non-nil reference types are not nil and (2) casts such as "x to !"
Using these won't completely eliminate overhead, but will greatly reduce it.
I agree these should be available as compile-time options that affect the code generation. I encourage you to submit your first ticket.
At run-time, you can turn off checks like so:
CobraCore.willCheckInvariant = false
CobraCore.willCheckEnsure = false
# there are 5 CobraCore shared properties for this:
pro willCheckInvariant from var
pro willCheckRequire from var
pro willCheckEnsure from var
pro willCheckAssert from var
pro willCheckNil from var
.willCheckNil affects (1) checking that parameters with non-nil reference types are not nil and (2) casts such as "x to !"
Using these won't completely eliminate overhead, but will greatly reduce it.
I agree these should be available as compile-time options that affect the code generation. I encourage you to submit your first ticket.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: DbC Control
Chuck wrote:I agree these should be available as compile-time options that affect the code generation. I encourage you to submit your first ticket.
Done.
Thanks for your help,
Steve
--
- Steve
- Posts: 9
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests