Why to have properties to sort or duplicate arrays ?
Bill Baxter
dnewsgroup at billbaxter.com
Sat Jan 27 17:29:01 PST 2007
Hasan Aljudy wrote:
>
>
> Pierre Renié wrote:
>> Hello,
>> To me, reading a field or a property should not modify the object.
>> The problem is that just an access to the properties 'reverse' or
>> 'sort' are modifying my array. These 2 properties should be method
>> instead.
>>
>> I think that the property 'dup' should be a method too, because 'dup'
>> is not a value of my Array object, it does something.
>
> Well, in D, properties are just normal methods.
Which allows one to write nifty code like:
writefln = 5
Yay.
Not a big priority, but I do wish there were a way to specify which
functions should be treated as properties.
--bb
More information about the Digitalmars-d
mailing list