"The last feature": scope structs
Jacob Carlborg
doob at me.com
Mon Feb 8 02:38:05 PST 2010
On 2/8/10 11:05, Walter Bright wrote:
> Lars T. Kyllingstad wrote:
>> Though the feature seems useful, I worry about the asymmetry with
>> scope classes. I think it will be very confusing to new D programmers
>> that a scope class and a scope struct have very little to do with each
>> other.
>
> I agree, except I more and more think that scope classes were a mistake.
> Structs with destructors are a much better solution, and wrapping a
> class inside a struct would give it RAII semantics.
Scope class seems like a workaround in D1 because it doesn't got structs
with constructors and destructors. If scope classes are up for removal
shouldn't struct constructors be fixed to allow to do the same as class
constructors? For example, allow empty parameter lists.
/Jacob Carlborg
More information about the Digitalmars-d
mailing list