September 03, 2008 DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Struct constructors! http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.035.zip http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.019.zip |
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Reply to Walter,
> Struct constructors!
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.035.zip
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.019.zip
bug soup!!!! :-)
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > Struct constructors! > > http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.035.zip Nice release, thanks! One nit: running "dmd" still says "Digital Mars D Compiler v1.034". -- E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi |
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matti Niemenmaa | Matti Niemenmaa wrote:
> Nice release, thanks! One nit: running "dmd" still says "Digital Mars D Compiler
> v1.034".
Fixed!
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Great update once again, thanks!
> Special member functions _ctor, _dtor, etc., now have two leading _ in order to not conflict with the user identifier space.
Ow, just rename this/~this to ctor/dtor and get it over with! :O
L.
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Are opCalls deprecated now ? how do i call the ctor and how the opCall? a short example in the docs would have been nice.
nice release though. thanks for the bugfixing!
Walter Bright wrote:
> Struct constructors!
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.035.zip
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.019.zip
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | And why is it that there is no default ctor allowed for structs ?
struct S{this(){}} //constructor main.S.this default constructor not allowed for structs
Walter Bright wrote:
> Struct constructors!
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.035.zip
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.019.zip
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Extrawurst | To construct an object of struct S:
auto s = S(arguments);
Extrawurst wrote:
> Are opCalls deprecated now ? how do i call the ctor and how the opCall? a short example in the docs would have been nice.
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | yeah i figured, but if i have an opCall with the exact same arguments its never called, isnt that ambiguous ? what happens to opcall anyway ? will it sooner or later fall out ?
Walter Bright wrote:
> To construct an object of struct S:
>
> auto s = S(arguments);
>
> Extrawurst wrote:
>> Are opCalls deprecated now ? how do i call the ctor and how the opCall? a short example in the docs would have been nice.
|
September 03, 2008 Re: DMD 1.035 and 2.019 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Extrawurst | Extrawurst wrote:
> And why is it that there is no default ctor allowed for structs ?
Good question. Because:
1. Having a default ctor conflicts with the concept of a .init property.
2. Using .init for default construction guarantees it can never throw, which is a useful property in many generic programming circumstances
3. It guarantees it is pure.
4. Nearly every instance of default construction I've seen would initialize it just to what .init does in D.
5. It eliminates the need for a member initializer syntax.
|
Copyright © 1999-2021 by the D Language Foundation