DMD 0.177 release
Kirk McDonald
kirklin.mcdonald at gmail.com
Sat Dec 9 12:15:06 PST 2006
Jarrett Billingsley wrote:
> "Walter Bright" <newshound at digitalmars.com> wrote in message
> news:ele2k9$2hr5$1 at digitaldaemon.com...
>
>>More ABI changes, and implicit [] => * no longer allowed.
>>
>>http://www.digitalmars.com/d/changelog.html
>>
>>http://ftp.digitalmars.com/dmd.175.zip
>
>
> No offense, but would it honestly kill you to allow ctors in structs? We've
> been using static opCall as a _workaround_ for the lack of struct ctors, and
> making it part of the language doesn't really seem to be addressing the
> problem. That, and it doesn't make any sense that classes use "this()" and
> structs use "static S opCall()". We're starting to get into "overloading
> indexing in C++" territory.
>
> That, and which would be more efficient? The static opCall needs to return
> an instance of the struct on the stack, which could be very inefficient for
> large structs. With a true ctor, the struct is passed by reference to the
> ctor and has its fields set directly.
>
> And I also can't figure out how to make the implicit opCall work with more
> than one parameter. :P
>
> I'm also a little wary about opAssign. Not that I don't find it useful,
> just that you've been vehemently opposed to overloading it in D for how many
> years, and three weeks before 1.0 you reverse your opinion. What does that
> mean?
>
The thing with opAssign, I realised after reading the spec, is that it
explicitly doesn't allow copy assignment. This reduces it from the level
of a powerful feature to a mere toy, or at most a form of implicit casting.
Assigning one struct to another still guarantees a bitwise copy, and
reference assignment for class instances cannot be stepped on. This
removes essentially all of the danger that opAssign might have introduced.
> But complaints aside, thanks for removing the []=>* implicit cast and the
> bugfixes. Man, this last month has been an exciting time for D :)
>
>
--
Kirk McDonald
Pyd: Wrapping Python with D
http://pyd.dsource.org
More information about the Digitalmars-d-announce
mailing list