suggestion of implicit new

Regan Heath regan at netwin.co.nz
Wed May 31 21:18:33 PDT 2006


On Wed, 31 May 2006 23:10:58 -0500, Craig Black <cblack at ara.com> wrote:
> "Tom S" <h3r3tic at remove.mat.uni.torun.pl> wrote in message
> news:e5l5o1$1foc$1 at digitaldaemon.com...
>> shinichiro.h wrote:
>>> Hi all,
>>>
>>> I guess D syntax can allow implicit new expression like following:
>>>
>>> class C {
>>>   this() {}
>>>   this(int x) {}
>>> }
>>> void func() {
>>>   C c = C();  // not new C()
>>>   c = C(3);   // not new C(3)
>>> }
>>>
>>> I think the syntax is cute. And the syntax is not ambiguous and does
>>> not make DMD slower. I have succeeded to implement the syntax into
>>
>> Well, it is ambiguous if the class contains a static opCall, but then
>> again, I'd suggest that syntax instead of the current 'auto' storage
>> modifier.
>
> I'll second that.  It seems like the nicest proposal so far to eliminate  
> the
> multiple meanings of "auto".

Thirded.. in fact I seem to recall Walter expressed a liking for it, as  
the solution to the double meaning of "auto", but then I later read all  
these threads re-hashing "auto" again and again, with no-one mentioning  
this and I think maybe I imagined it.

Regan



More information about the Digitalmars-d mailing list