Jump to page: 1 2
Thread overview
Design By Contract
Nov 02, 2006
Stephane Wirtel
Nov 02, 2006
Tom S
Nov 02, 2006
Stephane Wirtel
Nov 02, 2006
Bruno Medeiros
Nov 03, 2006
Georg Wrede
Nov 03, 2006
Don Clugston
Nov 03, 2006
Mike Parker
November 02, 2006
Hi all,

I don't know if there is a release mode or debug mode, so. I did not read the specs of D. I would like to known if is it possible to disable the design by contract in release mode ?

Thanks
November 02, 2006
Stephane Wirtel wrote:
> Hi all,
> 
> I don't know if there is a release mode or debug mode, so. I did not
> read the specs of D. I would like to known if is it possible to disable
> the design by contract in release mode ?

You can't disable 'design by contract' but you can disable runtime checks, including invariants, asserts, in/out contracts and array bounds checking by passing -release to the compiler.
November 02, 2006
> You can't disable 'design by contract' but you can disable runtime checks, including invariants, asserts, in/out contracts and array bounds checking by passing -release to the compiler.
thanks,

stephane
November 02, 2006
Stephane Wirtel wrote:
> Hi all,
> 
> I don't know if there is a release mode or debug mode, so. I did not
> read the specs of D. I would like to known if is it possible to disable
> the design by contract in release mode ?
> 
> Thanks

Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.

In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.

-- Chris Nicholson-Sauls
November 02, 2006
Chris Nicholson-Sauls wrote:

> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch. [...]

I usually call it "contract mode" instead.

--anders
November 02, 2006
Chris Nicholson-Sauls wrote:
> Stephane Wirtel wrote:
>> Hi all,
>>
>> I don't know if there is a release mode or debug mode, so. I did not
>> read the specs of D. I would like to known if is it possible to disable
>> the design by contract in release mode ?
>>
>> Thanks
> 
> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.
> 
> In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.
> 
> -- Chris Nicholson-Sauls

And what do you call "-release -debug" mode? It's confusing (perhaps unnecessarily) but the two options are not related, there are 4 "modes".


-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
November 02, 2006
Bruno Medeiros wrote:
> Chris Nicholson-Sauls wrote:
> 
>> Stephane Wirtel wrote:
>>
>>> Hi all,
>>>
>>> I don't know if there is a release mode or debug mode, so. I did not
>>> read the specs of D. I would like to known if is it possible to disable
>>> the design by contract in release mode ?
>>>
>>> Thanks
>>
>>
>> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.
>>
>> In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.
>>
>> -- Chris Nicholson-Sauls
> 
> 
> And what do you call "-release -debug" mode? It's confusing (perhaps unnecessarily) but the two options are not related, there are 4 "modes".
> 
> 

Personally, I call it "confounded mode" and never use it.  Not even sure what use it could have.

-- Chris Nicholson-Sauls
November 03, 2006
Chris Nicholson-Sauls wrote:
> Bruno Medeiros wrote:
> 
>> Chris Nicholson-Sauls wrote:
>>
>>> Stephane Wirtel wrote:
>>>
>>>> Hi all,
>>>>
>>>> I don't know if there is a release mode or debug mode, so. I did not
>>>> read the specs of D. I would like to known if is it possible to disable
>>>> the design by contract in release mode ?
>>>>
>>>> Thanks
>>>
>>>
>>>
>>> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.
>>>
>>> In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.
>>>
>>> -- Chris Nicholson-Sauls
>>
>>
>>
>> And what do you call "-release -debug" mode? It's confusing (perhaps unnecessarily) but the two options are not related, there are 4 "modes".
>>
>>
> 
> Personally, I call it "confounded mode" and never use it.  Not even sure what use it could have.

Debugging release code? :-)
November 03, 2006
Georg Wrede wrote:
> Chris Nicholson-Sauls wrote:
> 
>> Bruno Medeiros wrote:
>>
>>> Chris Nicholson-Sauls wrote:
>>>
>>>> Stephane Wirtel wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I don't know if there is a release mode or debug mode, so. I did not
>>>>> read the specs of D. I would like to known if is it possible to disable
>>>>> the design by contract in release mode ?
>>>>>
>>>>> Thanks
>>>>
>>>>
>>>>
>>>>
>>>> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.
>>>>
>>>> In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.
>>>>
>>>> -- Chris Nicholson-Sauls
>>>
>>>
>>>
>>>
>>> And what do you call "-release -debug" mode? It's confusing (perhaps unnecessarily) but the two options are not related, there are 4 "modes".
>>>
>>>
>>
>> Personally, I call it "confounded mode" and never use it.  Not even sure what use it could have.
> 
> 
> Debugging release code? :-)

Thank you for this most wonderful headache. :)

-- Chris Nicholson-Sauls
November 03, 2006
Chris Nicholson-Sauls wrote:
> Georg Wrede wrote:
>> Chris Nicholson-Sauls wrote:
>>
>>> Bruno Medeiros wrote:
>>>
>>>> Chris Nicholson-Sauls wrote:
>>>>
>>>>> Stephane Wirtel wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I don't know if there is a release mode or debug mode, so. I did not
>>>>>> read the specs of D. I would like to known if is it possible to disable
>>>>>> the design by contract in release mode ?
>>>>>>
>>>>>> Thanks
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Well, there is debug mode, release mode, and what I like to term "indifferent mode."  To get debug mode you, simply enough, pass the "-debug" command line switch to DMD.  To get release mode, you pass "-release" to it, which disables all the runtime features covered by Design-by-Contract, and a few other things.  To get "indifferent mode" just don't pass either switch.  I'm really not sure what to say about it, except that it neither passes the debug flag to the parser (there is a 'debug' attribute that can be used for applying debug-mode-only code, with an optional 'else' clause for its indifferent/release-mode counterpart), nor does it seem to cut out the features that release-mode cuts.  Its... just there.  Huh.
>>>>>
>>>>> In short, essentially... yes.  In release mode, all runtime Design-by-Contract (and other related things) are gone.
>>>>>
>>>>> -- Chris Nicholson-Sauls
>>>>
>>>>
>>>>
>>>>
>>>> And what do you call "-release -debug" mode? It's confusing (perhaps unnecessarily) but the two options are not related, there are 4 "modes".
>>>>
>>>>
>>>
>>> Personally, I call it "confounded mode" and never use it.  Not even sure what use it could have.
>>
>>
>> Debugging release code? :-)
> 
> Thank you for this most wonderful headache. :)

In my C++ code, the most common bugs only occur in release mode. I stopped using debug mode for that reason; in C++, I normally only use the equivalent of -release and -release -debug.
« First   ‹ Prev
1 2