[phobos] phobos commit, revision 1689

Steve Schveighoffer schveiguy at yahoo.com
Fri Jun 25 06:44:42 PDT 2010


And such a range would be dog-slow in an algorithm that assumes save() is quick.

-Steve



----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Fri, June 25, 2010 9:41:13 AM
> Subject: Re: [phobos] phobos commit, revision 1689
> 
> A range implemented as a class would define

T save() { return clone(); 
> }

Andrei

On 06/25/2010 08:24 AM, Steve Schveighoffer 
> wrote:
> In fact, save should not be implemented unless it looks like 
> this:
>
> T save() { return this; }
>
> So it's pretty 
> much a property.  If you implement save on ranges where the operation will 
> be costly, you are looking for trouble with algorithms that require 
> save.
>
> This is why I don't really like the concept of 
> save.
>
> -Steve
>
>
>
> ----- Original 
> Message ----
>> From: Lars Tandle Kyllingstad<
> ymailto="mailto:lars at kyllingen.net" 
> href="mailto:lars at kyllingen.net">lars at kyllingen.net>
>> To: 
> Discuss the phobos library for D<
> href="mailto:phobos at puremagic.com">phobos at puremagic.com>
>> 
> Sent: Fri, June 25, 2010 2:44:51 AM
>> Subject: Re: [phobos] phobos 
> commit, revision 1689
>>
>> Well said.  This is the rule 
> I am using as
>> well.
>
> 
> -Lars
>
>
>
> On Thu, 2010-06-24 at 11:49 -0700, Sean 
> Kelly
>> wrote:
>> All a matter of opinion, but I'd say that 
> @property should only
>> be applied to logical properties of the data 
> structure (go figure).  A
>> clone method (ie. save) doesn't 
> represent an attribute of the data, it's simply
>> a non-mutating 
> operation on the data.  An easy litmus test is whether the
>> 
> member could be replaced with a public variable.  If so, it's probably 
> a
>> property.  This is the real purpose of the no-parens syntax 
> anyway--it
>> allows the class designer to replace public data members 
> with functions at no
>> cost to the end user.
>>
>> 
> On Jun 23, 2010, at 7:45 AM, Andrei
>> Alexandrescu 
> wrote:
>>
>>> I think it should be a property. 
> I
>> followed the convention that stuff that doesn't change "this" is 
> a
>> property.
>>>
>>> 
> Andrei
>>>
>>> On
>> 06/23/2010 09:01 AM, David 
> Simcha wrote:
>>>> Isn't that the point
>> of 
> @property?  I just followed what Andrei was
>>>>
>> 
> doing.  If there's anywhere where I didn't put @property in, 
> it's
>> purely
>>>> an unintentional oversight.  
> Please let me know
>> and/or fix 
> it.
>>>>
>>>> On Wed, Jun 23, 2010 at 
> 9:34
>> AM, Max Samukha<
>> href="mailto:
> ymailto="mailto:maxsamukha at gmail.com" 
> href="mailto:maxsamukha at gmail.com">maxsamukha at gmail.com">
> ymailto="mailto:maxsamukha at gmail.com" 
> href="mailto:maxsamukha at gmail.com">maxsamukha at gmail.com
>>>>
>> 
> <mailto:
>> href="mailto:
> href="mailto:maxsamukha at gmail.com">maxsamukha at gmail.com">
> ymailto="mailto:maxsamukha at gmail.com" 
> href="mailto:maxsamukha at gmail.com">maxsamukha at gmail.com>>
>> 
> wrote:
>>>>
>>>>
>>>>
>>
>>>>  
>    On Wed, Jun 23, 2010 at 4:07 PM,
>> 
> href="http://dsource.org">
> href="http://dsource.org">dsource.org<
> target=_blank >http://dsource.org>
>>
>>>>  
>    <
>> href="mailto:
> href="mailto:noreply at dsource.org">noreply at dsource.org">
> ymailto="mailto:noreply at dsource.org" 
> href="mailto:noreply at dsource.org">noreply at dsource.org<mailto:
>> 
> ymailto="mailto:
> href="mailto:noreply at dsource.org">noreply at dsource.org"
>> 
> href="mailto:
> href="mailto:noreply at dsource.org">noreply at dsource.org">
> ymailto="mailto:noreply at dsource.org" 
> href="mailto:noreply at dsource.org">noreply at dsource.org>>  
> wrote:
>>
>>>>
>>>>      
>    phobos commit, revision
>> 
> 1689
>>>>
>>>>
>>>>
>>  
>   user: 
> dsimcha
>>>>
>>>>
>>>>
>>  
>   save() is sometimes attributed with @property, other times it 
> is
>>
>>>>     not. Is it really a property? I 
> don't think it is a good
>> idea to tag
>>>>  
>    every function with @property just to
>> make it callable 
> without ().
>>>>
>>>>
>> 
> _______________________________________________
>>>>
>> 
> phobos mailing list
>>>>
>> ymailto="mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com"
>> 
> href="mailto:
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com<mailto:
>> 
> ymailto="mailto:
> href="mailto:phobos at puremagic.com">phobos at puremagic.com"
>> 
> href="mailto:
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com>
>>
>>>>  
>   
> http://lists.puremagic.com/mailman/listinfo/phobos
>>
>>>>
>>>>
>>>>
>>>>
>>>>
>> 
> _______________________________________________
>>>> phobos 
> mailing
>> list
>>>>
>> href="mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>>>>
>> 
> href="
> >http://lists.puremagic.com/mailman/listinfo/phobos" 
> target=_blank
>>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>>>
>> 
> _______________________________________________
>>> phobos 
> mailing
>> list
>>>
>> href="mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>>>
>> 
> href="
> >http://lists.puremagic.com/mailman/listinfo/phobos" 
> target=_blank
>>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>>
>>
>> 
> _______________________________________________
>> phobos 
> mailing
>> list
>>
>> href="mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>>
>> 
> href="
> >http://lists.puremagic.com/mailman/listinfo/phobos" 
> target=_blank
>>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>
>
> 
> _______________________________________________
> phobos
>> 
> mailing list
>
>> href="mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com">
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>
>> 
> href="
> >http://lists.puremagic.com/mailman/listinfo/phobos" 
> target=_blank
>>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>
> 
> _______________________________________________
> phobos mailing 
> list
> 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos 
> mailing list

> href="mailto:phobos at puremagic.com">phobos at puremagic.com

> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos


      


More information about the phobos mailing list