Re: boolean over multiple variables

2010-01-25 Thread Nick Sabalausky
"strtr" wrote in message news:hjd6t1$be...@digitalmars.com... > This may be is a very basic question, but is there a way to let me omit a > repeating variable when doing multiple boolean operations? > > if ( var == a || var == b || var == c || var == d) > if ( var == (a || b || c || d) ) I do t

Re: Timer library?

2010-01-25 Thread Pelle Månsson
On 01/25/2010 04:02 PM, strtr wrote: Stanislav Blinov Wrote: Pelle M�nsson wrote: I'm in need for a timer library that measures the acutal time. I have tried std.c.time's clock(), but it only measures time spent inside the program, not actual time elapsed. I need at least millisecond resoluti

Re: boolean over multiple variables

2010-01-25 Thread Simen kjaeraas
Pelle Månsson wrote: Interesting solution! Very clever! Thank you. I still think opIn_r should be defined for arrays, though. :) Yeah, but currently, 'a in b' means '(∃b[a])', that is, 'is a a valid index in b'. This means having 'a in b' mean '(∃i)( b[i] = a )', that is, 'is there such a

Is there any (Matlab-like) plotting library for D?

2010-01-25 Thread Trass3r
I know there's DPlot but it hasn't been updated since 2007 etc. Is there any other plotting library? maybe offering something simple like in Matlab: surf(matrix); plot(array);

Re: boolean over multiple variables

2010-01-25 Thread Pelle Månsson
On 01/25/2010 10:28 AM, Simen kjaeraas wrote: On Mon, 25 Jan 2010 09:59:42 +0100, Pelle Månsson wrote: On 01/23/2010 12:29 AM, strtr wrote: Simen kjaeraas Wrote: Not tested, but they should work: if ( anySame( var, a, b, c, d ) ) { } if ( allSame( var, a, b, c, d ) ) { } A lot prettie

Re: Timer library?

2010-01-25 Thread strtr
Lars T. Kyllingstad Wrote: > It's not undocumented, it's just badly linked-to. :) > > http://www.digitalmars.com/d/2.0/phobos/std_perf.html > > -Lars http://www.digitalmars.com/d/1.0/phobos/std_perf.html

Re: Timer library?

2010-01-25 Thread Lars T. Kyllingstad
strtr wrote: Stanislav Blinov Wrote: Pelle M幩sson wrote: I'm in need for a timer library that measures the acutal time. I have tried std.c.time's clock(), but it only measures time spent inside the program, not actual time elapsed. I need at least millisecond resolution, so std.c.time.time(

Re: Timer library?

2010-01-25 Thread strtr
Stanislav Blinov Wrote: > Pelle Månsson wrote: > > I'm in need for a timer library that measures the acutal time. I have > > tried std.c.time's clock(), but it only measures time spent inside the > > program, not actual time elapsed. > > > > I need at least millisecond resolution, so std.c.time

Re: incomprehensible return error bug?

2010-01-25 Thread strtr
g Wrote: > g Wrote: > > > strtr Wrote: > > > > > strtr Wrote: > > > > > > > This error also points to the enum which is probably incorrectly used > > > > somewhere > > > > s_def(32) Error: cannot implicitly convert expression (5) of type int > > > > to S > > > > > > > > Still searching for t

Re: boolean over multiple variables

2010-01-25 Thread strtr
Simen kjaeraas Wrote: > On Mon, 25 Jan 2010 09:59:42 +0100, Pelle MÃ¥nsson > wrote: > > > On 01/23/2010 12:29 AM, strtr wrote: > >> Simen kjaeraas Wrote: > >> > >>> > >>> Not tested, but they should work: > >>> > >>> if ( anySame( var, a, b, c, d ) ) { > >>> } > >>> > >>> if ( allSame( var, a,

Re: D2 __gshared and compatibility with D1

2010-01-25 Thread Stanislav Blinov
Mike Wey wrote: With GtkD we define a function that returns an empty string or one containing __gshared depending on the dmd version, and then mixes that in with the function pointers Thank you, that is an interesting option.

Re: Timer library?

2010-01-25 Thread Stanislav Blinov
Pelle Månsson wrote: I'm in need for a timer library that measures the acutal time. I have tried std.c.time's clock(), but it only measures time spent inside the program, not actual time elapsed. I need at least millisecond resolution, so std.c.time.time() is not an option. I wonder, is the

Re: boolean over multiple variables

2010-01-25 Thread Simen kjaeraas
On Mon, 25 Jan 2010 09:59:42 +0100, Pelle Månsson wrote: On 01/23/2010 12:29 AM, strtr wrote: Simen kjaeraas Wrote: Not tested, but they should work: if ( anySame( var, a, b, c, d ) ) { } if ( allSame( var, a, b, c, d ) ) { } A lot prettier. I thought there would be a generic (basic)

Timer library?

2010-01-25 Thread Pelle Månsson
I'm in need for a timer library that measures the acutal time. I have tried std.c.time's clock(), but it only measures time spent inside the program, not actual time elapsed. I need at least millisecond resolution, so std.c.time.time() is not an option. I wonder, is there a good library for

Re: boolean over multiple variables

2010-01-25 Thread Pelle Månsson
On 01/23/2010 12:29 AM, strtr wrote: Simen kjaeraas Wrote: Not tested, but they should work: if ( anySame( var, a, b, c, d ) ) { } if ( allSame( var, a, b, c, d ) ) { } A lot prettier. I thought there would be a generic (basic) solution to this which I just didn't know about but maybe I