Re: How do I use in contract with interface?

2017-11-15 Thread Dr. Assembly via Digitalmars-d-learn
out(result) {} run fine, if foo() return 0, an exception is throw by assert() but in doesn't work. I don't know what I'm missing. It' my first time using contracts

How do I use in contract with interface?

2017-11-15 Thread Dr. Assembly via Digitalmars-d-learn
I'm learning to use interface with contracts. In below code, in isn't being "called". Can someone point out why? what am I doing wrong? void main() { C c = new C(); writeln(c.foo(1)); } interface I { int foo(int i) in { assert(i > 2); }

Re: string version of array

2017-11-14 Thread Dr. Assembly via Digitalmars-d-learn
On Tuesday, 14 November 2017 at 08:21:59 UTC, Tony wrote: On Tuesday, 14 November 2017 at 07:56:06 UTC, rikki cattermole wrote: On 14/11/2017 7:54 AM, Tony wrote: Is there an easy way to get the string representation of an array, as would be printed by writeln(), but captured in a string?

setting file version, description, product name, etc

2017-11-11 Thread Dr. Assembly via Digitalmars-d-learn
I'm using below resource file as the following: "C:\dm\bin\rcc.exe" -32 -D__NT__ res.rc dmd -m32 -debug app.d res.res The icon is the only thing that is set. Everything else is missing from application's attributes. What am I missing? res.rc: IDI_ICON1 ICONDISCARDABLE

Re: Any book recommendation for writing a compiler?

2017-11-01 Thread Dr. Assembly via Digitalmars-d-learn
On Wednesday, 1 November 2017 at 20:53:44 UTC, Dr. Assembly wrote: Hey guys, if I were to get into dmd's source code to play a little bit (just for fun, no commercial use at all), which books/resources do you recommend to start out? I'd like something on back-end too, for example, code

Any book recommendation for writing a compiler?

2017-11-01 Thread Dr. Assembly via Digitalmars-d-learn
Hey guys, if I were to get into dmd's source code to play a little bit (just for fun, no commercial use at all), which books/resources do you recommend to start out?

Re: "version" private word

2017-10-31 Thread Dr. Assembly via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 15:20:31 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:54:27 UTC, Dr. Assembly wrote: On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, Igor Shirkalin wrote: [...] The only alternative is to do something

Re: "version" private word

2017-10-31 Thread Dr. Assembly via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, Igor Shirkalin wrote: Hello! We need some conditional compilation using 'version'. Say we have some code to be compiled for X86 and X86_64. How can we do that using predefined (or other) versions? Examples: