Fixing const arrays

Jakob Ovrum jakobovrum at gmail.com
Mon Dec 12 07:34:28 PST 2011


On Monday, 12 December 2011 at 15:29:26 UTC, Jakob Ovrum wrote:
> On Monday, 12 December 2011 at 15:14:02 UTC, Andrei 
> Alexandrescu wrote:
>> On 12/12/11 9:07 AM, Jakob Ovrum wrote:
>>> If the programmer sees just "r.save", he
>>> doesn't know whether it's a field or a property, and he 
>>> shouldn't need
>>> to know, it should be fast and cheap, and return a consistent 
>>> value. As
>>> far as I know, this isn't always true for save
>>
>> Why? Save does behave like a field for the vast majority of 
>> structs.
>>
>> Andrei
>
> But save is an abstract interface function, its signature 
> should reflect all possible implementations.

Adding on this: I have no problem with save being a property if 
it's meant/designed to be cheap etc. like with most struct ranges 
and slices.

I also don't think the name is a problem; if you want to be 
really pedantic, "save" is actually a noun as well :P


More information about the Digitalmars-d mailing list