re: Scope/block behaviour

2010-08-21 Thread Eduardo Cavazos
Andrei Alexandrescu wrote: > Mind submitting a bug report please? Done: http://d.puremagic.com/issues/show_bug.cgi?id=4699 Ed

Re: Scope/block behaviour

2010-08-21 Thread Andrei Alexandrescu
On 08/21/2010 01:21 AM, Eduardo Cavazos wrote: > void main () > { > { int f0 () { return 10 ; } } > > { int f0 () { return 20 ; } } > } Stewart Gordon wrote: > Looks like a bug. The compiler recognizes the situation and reports it as an error, so it seems like this is not a bug, but so

re: Scope/block behaviour

2010-08-20 Thread Eduardo Cavazos
> void main () > { > { int f0 () { return 10 ; } } > > { int f0 () { return 20 ; } } > } Stewart Gordon wrote: > Looks like a bug. The compiler recognizes the situation and reports it as an error, so it seems like this is not a bug, but something which is not supported: ~/scratch $

Re: welcome! [Re: Scope/block behaviour]

2010-08-19 Thread Yao G.
On Thu, 19 Aug 2010 14:57:09 -0500, Stanislav Blinov wrote: So? :) So what? -- Yao G.

Re: welcome! [Re: Scope/block behaviour]

2010-08-19 Thread Stanislav Blinov
Yao G. wrote: On Thu, 19 Aug 2010 10:22:25 -0500, Graham Fawcett wrote: Hi Eduardo, I just wanted to welcome you to the list! I've come across your posts (on Scheme and Factor) on various other lists, and I've enjoyed the self-contained experiments you've posted about those languages. (You m

Re: welcome! [Re: Scope/block behaviour]

2010-08-19 Thread Yao G.
On Thu, 19 Aug 2010 10:22:25 -0500, Graham Fawcett wrote: Hi Eduardo, I just wanted to welcome you to the list! I've come across your posts (on Scheme and Factor) on various other lists, and I've enjoyed the self-contained experiments you've posted about those languages. (You may have a comp

welcome! [Re: Scope/block behaviour]

2010-08-19 Thread Graham Fawcett
Hi Eduardo, I just wanted to welcome you to the list! I've come across your posts (on Scheme and Factor) on various other lists, and I've enjoyed the self-contained experiments you've posted about those languages. (You may have a compatriot in our resident member Bearophile, whose posts sometimes

Re: Scope/block behaviour

2010-08-19 Thread bearophile
Andrei Alexandrescu: > Allowing global symbol masking > is necessary for writing good modular code that's assembled out of > separately compiled parts; you don't want the addition of a global > variable to suddenly render various innocent bystanders uncompilable. When you import modules

Re: Scope/block behaviour

2010-08-19 Thread Andrei Alexandrescu
On 08/19/2010 07:06 AM, Eduardo Cavazos wrote: Hello, I was surprised that these seem to not be allowed in D: void main () { auto a = 20 ; { auto a = 30 ; } } void main () { { int f0 () { return 10 ; } } { int f0 () { return 20 ; } } } Perhaps I missed something in the FAQ. Is there anywhe

Re: Scope/block behaviour

2010-08-19 Thread Stewart Gordon
Eduardo Cavazos wrote: Hello, I was surprised that these seem to not be allowed in D: void main () { auto a = 20 ; { auto a = 30 ; } } Correct. http://www.digitalmars.com/d/1.0/statement.html#ScopeStatement "Even though a new scope is introduced, local symbol declarations cannot