January 07, 2009
Denis Koroskin wrote:
> On Wed, 07 Jan 2009 07:03:27 +0300, Bill Baxter <wbaxter@gmail.com> wrote:
> 
>> 2009/1/7 Walter Bright <newshound1@digitalmars.com>:
>>> Faster long divides!
>>
>> No progress on "faster long compiles" though?
>>
>> --bb
> 
> Small statistics on compilation time of my small project:
> 
> DMD2.021 - 16 seconds
> DMD2.022 - 46 seconds
> DMD2.023 - 15 seconds (and an Internal error: ..\ztc\cod4.c 357 on one of source code files) :)


Wow this one really sucks. For me this makes nearly every D2 using project unbuildable ;(
January 07, 2009
I'm happy to see Bugzilla 2518(scope(success) not execuate and RAII variable destructor is not called) has been fixed, Great !

I have some questions when I check dstress suite and Bugzilla.

In Bugzilla 99,  according to test case:

int main(){
	int i;

label:
	{
		scope(exit) i++;
		i=3;
	}

	if(i != 4){
		assert(0);
	}

	return 0;
}

You said:

The test case behaves as expected, because labels do not introduce a new scope when followed by { }.


Then I check the online manual, and found:

labels, scope(), pragma, condition compile(version/debug/static if) would be followed by NonScopeStatement.

It is easy to understand scope/condition compile followed by a NonScopeStatement, but what is the meaning of  "Labeled Statements"  + NonScopeStatement ?

If I understand the rule I would make least mistakes, so can you do some explain for me ?  Thanks.





Walter Bright Wrote:

> Faster long divides!
> 
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.039.zip
> 
> 
> 
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.023.zip

January 07, 2009
"2527: Alias Template Params Are Always Same Type As First Instantiation (according to typeof(x).stringof)"

Hooray! Thanks :) That one's a big help for me.


January 07, 2009
torhu wrote:
> 1.039 hangs while trying to build my DWT app, just like 1.038 did.  It just seems to never finish, so I kill it after a while.  Don't know if it's related to this issue or not.

I need a reproducible example.
January 07, 2009
redsea wrote:
> I'm happy to see Bugzilla 2518(scope(success) not execuate and RAII
> variable destructor is not called) has been fixed, Great !
> 
> I have some questions when I check dstress suite and Bugzilla.
> 
> In Bugzilla 99,  according to test case:
> 
> int main(){ int i;  label: { scope(exit) i++; i=3; }
> 
> if(i != 4){ assert(0); }
> 
> return 0; }
> 
> You said:
> 
> The test case behaves as expected, because labels do not introduce a
> new scope when followed by { }.
> 
> 
> Then I check the online manual, and found:
> 
> labels, scope(), pragma, condition compile(version/debug/static if)
> would be followed by NonScopeStatement.
> 
> It is easy to understand scope/condition compile followed by a
> NonScopeStatement, but what is the meaning of  "Labeled Statements"
> + NonScopeStatement ?

A NonScopeStatement is a statement that, even if it has { }, does not introduce a new scope.

> 
> If I understand the rule I would make least mistakes, so can you do
> some explain for me ?  Thanks.
January 08, 2009
Walter Bright Wrote:

> redsea wrote:
> > I'm happy to see Bugzilla 2518(scope(success) not execuate and RAII
> > variable destructor is not called) has been fixed, Great !
> > 
> > I have some questions when I check dstress suite and Bugzilla.
> > 
> > In Bugzilla 99,  according to test case:
> > 
> > int main(){ int i;  label: { scope(exit) i++; i=3; }
> > 
> > if(i != 4){ assert(0); }
> > 
> > return 0; }
> > 
> > You said:
> > 
> > The test case behaves as expected, because labels do not introduce a new scope when followed by { }.
> > 
> > 
> > Then I check the online manual, and found:
> > 
> > labels, scope(), pragma, condition compile(version/debug/static if)
> > would be followed by NonScopeStatement.
> > 
> > It is easy to understand scope/condition compile followed by a NonScopeStatement, but what is the meaning of  "Labeled Statements" + NonScopeStatement ?
> 
> A NonScopeStatement is a statement that, even if it has { }, does not introduce a new scope.

I don't think this answers their question. What curly braces mean after a label is clearly a design decision that you made when writing D. It seems that the choice is the opposite of what people expect. Can you explain why it should be NonScope?

> > 
> > If I understand the rule I would make least mistakes, so can you do some explain for me ?  Thanks.

January 08, 2009
Jason House wrote:
> Walter Bright Wrote:
> 
>> redsea wrote:
>>> I'm happy to see Bugzilla 2518(scope(success) not execuate and RAII
>>> variable destructor is not called) has been fixed, Great !
>>>
>>> I have some questions when I check dstress suite and Bugzilla.
>>>
>>> In Bugzilla 99,  according to test case:
>>>
>>> int main(){ int i;  label: { scope(exit) i++; i=3; }
>>>
>>> if(i != 4){ assert(0); }
>>>
>>> return 0; }
>>>
>>> You said:
>>>
>>> The test case behaves as expected, because labels do not introduce a new scope when followed by { }.
>>>
>>>
>>> Then I check the online manual, and found:
>>>
>>> labels, scope(), pragma, condition compile(version/debug/static if)
>>> would be followed by NonScopeStatement.
>>>
>>> It is easy to understand scope/condition compile followed by a NonScopeStatement, but what is the meaning of  "Labeled Statements" + NonScopeStatement ?
>> A NonScopeStatement is a statement that, even if it has { }, does not introduce a new scope.
> 
> I don't think this answers their question. What curly braces mean after a label is clearly a design decision that you made when writing D. It seems that the choice is the opposite of what people expect. Can you explain why it should be NonScope?

Restating in the form of a question... When would you _ever_ want {...} to not form a scope?

Later,
Brad
January 08, 2009
On Thu, 08 Jan 2009 06:25:11 +0300, Brad Roberts <braddr@puremagic.com> wrote:

> Jason House wrote:
>> Walter Bright Wrote:
>>
>>> redsea wrote:
>>>> I'm happy to see Bugzilla 2518(scope(success) not execuate and RAII
>>>> variable destructor is not called) has been fixed, Great !
>>>>
>>>> I have some questions when I check dstress suite and Bugzilla.
>>>>
>>>> In Bugzilla 99,  according to test case:
>>>>
>>>> int main(){ int i;  label: { scope(exit) i++; i=3; }
>>>>
>>>> if(i != 4){ assert(0); }
>>>>
>>>> return 0; }
>>>>
>>>> You said:
>>>>
>>>> The test case behaves as expected, because labels do not introduce a
>>>> new scope when followed by { }.
>>>>
>>>>
>>>> Then I check the online manual, and found:
>>>>
>>>> labels, scope(), pragma, condition compile(version/debug/static if)
>>>> would be followed by NonScopeStatement.
>>>>
>>>> It is easy to understand scope/condition compile followed by a
>>>> NonScopeStatement, but what is the meaning of  "Labeled Statements"
>>>> + NonScopeStatement ?
>>> A NonScopeStatement is a statement that, even if it has { }, does not
>>> introduce a new scope.
>>
>> I don't think this answers their question. What curly braces mean
>> after a label is clearly a design decision that you made when writing
>> D. It seems that the choice is the opposite of what people expect.
>> Can you explain why it should be NonScope?
>
> Restating in the form of a question... When would you _ever_ want {...}
> to not form a scope?
>
> Later,
> Brad

The only possible example I can think of is a case inside switch:

switch (i)
{
   case 42:
   {

   }
}
January 08, 2009
Reply to Brad,

> Restating in the form of a question... When would you _ever_ want
> {...} to not form a scope?
> 

static if(foo)
{
   int i;
   float x;
}


January 08, 2009
On Thu, 08 Jan 2009 07:22:53 +0300, BCS <ao@pathlink.com> wrote:

> Reply to Brad,
>
>> Restating in the form of a question... When would you _ever_ want
>> {...} to not form a scope?
>>
>
> static if(foo)
> {
>     int i;
>     float x;
> }
>
>

Yeah, and version(foo) belongs here, too.