Re: rebuild configuration

2010-05-18 Thread Trass3r

I recommend not to use rebuild anymore.
It's horribly outdated.

xfBuild is quite neat.


Re: Three legitimate bugs? (D1.061)

2010-05-18 Thread Don

bearophile wrote:

Steven Schveighoffer:
No, I was simply wrong :)  I think it's by design.  Which means the  
original bug report is valid.


The original bug report is valid, but I don't understand that code still. Is 
the const implying a static only in some situations?

Why is this OK for the compiler:

struct Foo {
const Foo f = Foo();
}
static assert(Foo.sizeof == 1);
void main() {}


While this is not OK for the compiler?

struct Foo {
const Foo f;
}
static assert(Foo.sizeof == 1);
void main() {}

Bye,
bearophile


In D1, the two are totally different. The second one is the only 
situation in D1 where 'const' doesn't mean compile-time constant.
I guess the same behaviour has been applied in D2, but I'm not sure if 
that's intentional or not.


Re: Three legitimate bugs? (D1.061)

2010-05-18 Thread Don

Don wrote:

bearophile wrote:

Steven Schveighoffer:
No, I was simply wrong :)  I think it's by design.  Which means the  
original bug report is valid.


The original bug report is valid, but I don't understand that code 
still. Is the const implying a static only in some situations?


Why is this OK for the compiler:

struct Foo {
const Foo f = Foo();
}
static assert(Foo.sizeof == 1);
void main() {}


While this is not OK for the compiler?

struct Foo {
const Foo f;
}
static assert(Foo.sizeof == 1);
void main() {}

Bye,
bearophile


In D1, the two are totally different. The second one is the only 
situation in D1 where 'const' doesn't mean compile-time constant.
I guess the same behaviour has been applied in D2, but I'm not sure if 
that's intentional or not.


D'oh, should read the title. This was a D1 question. Yes it's 
intentional, and yes it's confusing.


Re: Loop optimization

2010-05-18 Thread Walter Bright

bearophile wrote:

Walter Bright:


In my view, such switches are bad news, because:<


The Intel compiler, Microsoft compiler, GCC and LLVM have a similar switch
(fp:fast in the Microsoft compiler, -ffast-math on GCC, etc). So you might
send your list of comments to the devs of each of those four compilers.


If I agreed with everything other vendors did with their compilers, I wouldn't 
have built my own .





Re: Three legitimate bugs? (D1.061)

2010-05-18 Thread bearophile
Don:
> D'oh, should read the title. This was a D1 question. Yes it's 
> intentional, and yes it's confusing.

Sorry, I have added more confusion.
I have added this, but I have used DMD2:
http://d.puremagic.com/issues/show_bug.cgi?id=4203

Bye,
bearophile


Re: rebuild configuration

2010-05-18 Thread theambient

thanks.

I've decided to quit rebuild too, besides I've found VisualD!!!

--
Ruslan Mullakhmetov

"Trass3r"  сообщил(а) в новостях 
следующее:op.vcwiqeux3nc...@enigma.fem.tu-ilmenau.de...

I recommend not to use rebuild anymore.
It's horribly outdated.

xfBuild is quite neat. 




Re: rebuild configuration

2010-05-18 Thread Bill Baxter
I recently ran into Gregor Richards unexpectedly outside the context of D.
It sounds like he's busy with grad school and not likely to turn back
to development of Rebuild/DSSS any time soon.

--bb

On Tue, May 18, 2010 at 1:45 PM, theambient  wrote:
> thanks.
>
> I've decided to quit rebuild too, besides I've found VisualD!!!
>
> --
> Ruslan Mullakhmetov
>
> "Trass3r"  сообщил(а) в новостях
> следующее:op.vcwiqeux3nc...@enigma.fem.tu-ilmenau.de...
>>
>> I recommend not to use rebuild anymore.
>> It's horribly outdated.
>>
>> xfBuild is quite neat.
>
>


std.range and opApply

2010-05-18 Thread bearophile
What's the attitude of std.range toward opApply?
In some situations I use opApply (and I think some syntax sugar can be added to 
define a yield, to make a third way to define lazy iterables in D) and I'd like 
to write code like this too:
take(Range(100), 8)


import std.range: isInputRange, take;

struct Range {
int stop;
int opApply(int delegate(ref int) dg) {
int result;

for (int i = 0; i < stop; i++) {
result = dg(i);
if (result)
break;
}

return result;
}
}

void main() {
assert(isInputRange!Range);
auto r = take(Range(100), 8);
}


Is it planned to improve those std.range functions to work with opApply too, or 
do I have to rewrite them all and them some in my dlibs2, so they can support 
both the range protocol and opApply?

Bye,
bearophile