August 26, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | Yah... I've always said - openrj is the Andy Warhol of file formats.
Andrei
On 8/26/10 10:14 PDT, David Simcha wrote:
> We should deprecate std.openrj just because the format itself seems de facto deprecated. Check out this awesome list of Wikipedia hits for it:
>
> http://en.wikipedia.org/wiki/Special:Search?search=openrj&sourceid=Mozilla-search <http://en.wikipedia.org/wiki/Special:Search?search=openrj&sourceid=Mozilla-search>
>
> On Thu, Aug 26, 2010 at 12:56 PM, Walter Bright <walter at digitalmars.com <mailto:walter at digitalmars.com>> wrote:
>
>
>
> SHOO wrote:
>
> (2010/08/24 5:49), Walter Bright wrote:
>
> Deprecate std.perf, too.
>
>
> How about std.openrj? I think it should mark deprecated, too.
>
>
> Sure, it's just that std.perf overlaps functionality with your new code.
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com <mailto:phobos at puremagic.com>
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
|
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsource.org | Here's one small cleanup request I noticed when actually using StopWatch. The following is absurdly verbose and makes me feel like I'm programming in Java: auto sw = new StopWatch(StopWatch.AutoStart.yes); Could we move the AutoStart enum into the module-level namespace instead of the StopWatch class namespace, and maybe give it a default value of yes, just to make instantiating StopWatch less verbose? On 8/22/2010 11:11 AM, dsource.org wrote: > phobos commit, revision 1919 > > > user: SHOO > > msg: > Added stopwatch module > > Added StopWatch, Ticks, systime, apptime, comparingBenchmark, measureTime. > > http://www.dsource.org/projects/phobos/changeset/1919 > > _______________________________________________ > phobos mailing list > phobos at puremagic.com > http://lists.puremagic.com/mailman/listinfo/phobos > |
August 28, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | (2010/08/27 22:21), David Simcha wrote:
> Here's one small cleanup request I noticed when actually using StopWatch. The following is absurdly verbose and makes me feel like I'm programming in Java:
>
> auto sw = new StopWatch(StopWatch.AutoStart.yes);
>
> Could we move the AutoStart enum into the module-level namespace instead of the StopWatch class namespace, and maybe give it a default value of yes, just to make instantiating StopWatch less verbose?
>
> On 8/22/2010 11:11 AM, dsource.org wrote:
>> phobos commit, revision 1919
>>
>>
>> user: SHOO
>>
>> msg:
>> Added stopwatch module
>>
>> Added StopWatch, Ticks, systime, apptime, comparingBenchmark, measureTime.
>>
>> http://www.dsource.org/projects/phobos/changeset/1919
>>
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>>
You can use:
auto sw = new StopWatch(autoStart);
AutoStart.yes is redundant expression.
And, it is impossible to make default behavior of the StopWatch
AutoStart.yes.
This comes from that StopWatch is a struct.
struct cannot run default behavior.
|
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to SHOO | My bad. For some reason I kept thinking StopWatch was a class. On Fri, Aug 27, 2010 at 1:18 PM, SHOO <zan77137 at nifty.com> wrote: > (2010/08/27 22:21), David Simcha wrote: > >> Here's one small cleanup request I noticed when actually using StopWatch. The following is absurdly verbose and makes me feel like I'm programming in Java: >> >> auto sw = new StopWatch(StopWatch.AutoStart.yes); >> >> Could we move the AutoStart enum into the module-level namespace instead of the StopWatch class namespace, and maybe give it a default value of yes, just to make instantiating StopWatch less verbose? >> >> On 8/22/2010 11:11 AM, dsource.org wrote: >> >>> phobos commit, revision 1919 >>> >>> >>> user: SHOO >>> >>> msg: >>> Added stopwatch module >>> >>> Added StopWatch, Ticks, systime, apptime, comparingBenchmark, measureTime. >>> >>> http://www.dsource.org/projects/phobos/changeset/1919 >>> >>> _______________________________________________ >>> phobos mailing list >>> phobos at puremagic.com >>> http://lists.puremagic.com/mailman/listinfo/phobos >>> >>> > You can use: > auto sw = new StopWatch(autoStart); > > AutoStart.yes is redundant expression. > And, it is impossible to make default behavior of the StopWatch > AutoStart.yes. > > This comes from that StopWatch is a struct. > struct cannot run default behavior. > > _______________________________________________ > phobos mailing list > phobos at puremagic.com > http://lists.puremagic.com/mailman/listinfo/phobos > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100827/191ed992/attachment.html> |
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to SHOO | I agree that AutoStart should be a module-level enum.
Andrei
On 8/27/10 10:18 PDT, SHOO wrote:
> (2010/08/27 22:21), David Simcha wrote:
>> Here's one small cleanup request I noticed when actually using StopWatch. The following is absurdly verbose and makes me feel like I'm programming in Java:
>>
>> auto sw = new StopWatch(StopWatch.AutoStart.yes);
>>
>> Could we move the AutoStart enum into the module-level namespace instead of the StopWatch class namespace, and maybe give it a default value of yes, just to make instantiating StopWatch less verbose?
>>
>> On 8/22/2010 11:11 AM, dsource.org wrote:
>>> phobos commit, revision 1919
>>>
>>>
>>> user: SHOO
>>>
>>> msg:
>>> Added stopwatch module
>>>
>>> Added StopWatch, Ticks, systime, apptime, comparingBenchmark, measureTime.
>>>
>>> http://www.dsource.org/projects/phobos/changeset/1919
>>>
>>> _______________________________________________
>>> phobos mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>>
>
> You can use:
> auto sw = new StopWatch(autoStart);
>
> AutoStart.yes is redundant expression.
> And, it is impossible to make default behavior of the StopWatch
> AutoStart.yes.
>
> This comes from that StopWatch is a struct.
> struct cannot run default behavior.
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
|
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to SHOO | On Fri, 27 Aug 2010 12:18:19 -0500, SHOO <zan77137 at nifty.com> wrote: > You can use: > auto sw = new StopWatch(autoStart); > > AutoStart.yes is redundant expression. > And, it is impossible to make default behavior of the StopWatch > AutoStart.yes. > > This comes from that StopWatch is a struct. > struct cannot run default behavior. > _______________________________________________ > phobos mailing list > phobos at puremagic.com > http://lists.puremagic.com/mailman/listinfo/phobos How about a stopWatch function that returns a StopWatch struct, something like the std.range module does: > StopWatch stopWatch( AutoStart as = AutoStart.Yes ) > { > return StopWatch( as ); > } > > auto watch = stopWatch(); Or it would be too confusing? -- Yao G. |
August 28, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Yao G. | (2010/08/28 2:31), Yao G. wrote:
> On Fri, 27 Aug 2010 12:18:19 -0500, SHOO <zan77137 at nifty.com> wrote:
>
>> You can use:
>> auto sw = new StopWatch(autoStart);
>>
>> AutoStart.yes is redundant expression.
>> And, it is impossible to make default behavior of the StopWatch
>> AutoStart.yes.
>>
>> This comes from that StopWatch is a struct.
>> struct cannot run default behavior.
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>
> How about a stopWatch function that returns a StopWatch struct, something like the std.range module does:
>
>> StopWatch stopWatch( AutoStart as = AutoStart.Yes )
>> {
>> return StopWatch( as );
>> }
>>
>> auto watch = stopWatch();
>
> Or it would be too confusing?
>
>
stopWatch looks like a function to stop a watch...
And also, I think default behavior of the StopWatch is AutoStart.no.
The reason is because it's important that regulate time to start for
time measurement.
|
August 28, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | (2010/08/28 2:25), Andrei Alexandrescu wrote:
> I agree that AutoStart should be a module-level enum.
>
> Andrei
>
AutoStart is a value only for StopWatch.
I think that naturally it should belong to StopWatch.
You can evade it in autoStart about the long-windedness.
Is there any strong reason?
|
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to SHOO | On 8/27/10 10:55 PDT, SHOO wrote: > stopWatch looks like a function to stop a watch... I agree. > And also, I think default behavior of the StopWatch is AutoStart.no. The reason is because it's important that regulate time to start for time measurement. This is effectively a necessity dictated by the limitation of struct default constructors. I don't think it's a big problem in this particular case; probably I would have defined things the same way even if default constructors were available. Andrei |
August 27, 2010 [phobos] phobos commit, revision 1919 | ||||
---|---|---|---|---|
| ||||
Posted in reply to SHOO | On 8/27/10 11:05 PDT, SHOO wrote:
> (2010/08/28 2:25), Andrei Alexandrescu wrote:
>> I agree that AutoStart should be a module-level enum.
>>
>> Andrei
>>
>
> AutoStart is a value only for StopWatch.
> I think that naturally it should belong to StopWatch.
> You can evade it in autoStart about the long-windedness.
> Is there any strong reason?
Just the verboseness.
Andrei
|
Copyright © 1999-2021 by the D Language Foundation