>>>>> "DC" == Damian Conway <[EMAIL PROTECTED]> writes:
>> How would you handle differentiating between safe-coding practices and
>> debugging type (internal) pre/post conditions?
DC> Why would one bother?
There are two types, as I imagine them. Gatekeeper code. (Did the user
send me frobnitz?) and Internal consistency checkers. The internal
consistancy checkers would only be used perhaps during alpha, and
regression test phases (or even when a user has sent a complaint).
But the Gatekeeper code would be left around. But then for really
high performance it would be turned off.
I don't imagine that in the invariant you would want to do some of the
real and truly costly checks.
DC> A comment would serve to distinguish them, wouldn't it?
Not if one wanted to turn them off.
DC> However, I have given thought to allowing conditions to be grouped,
DC> and de-activated by group. This would probably meet your need.
DC> pre mymethod : group("safe-coding practice") { @_ > 0 }
DC> pre mymethod : group("debugging") { print @_, "\n"; }
Makes it difficult to specify on the command line. Unless you have
another way of matching them to higherarchy or perhaps a cost level?
"gatekeeper" => 1
"safe-coding practice" => 4
"sanity checks" => 10
"debugging" => 30
Dr. Meyers seems to offer that with Eiffel.
<chaim>
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183