welcome! [Re: Scope/block behaviour]

Graham Fawcett fawcett at uwindsor.ca
Thu Aug 19 08:22:25 PDT 2010


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 remind me of yours.)

I hope you'll stay for a while, and share your enthusiasm and design
sensibilities with the D community.

Cheers,
Graham


On Thu, 19 Aug 2010 07:06:50 -0500, 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 anywhere (manual or TDPL) I can read up on this language design
> decision? What other contemporary (or classic) languages feature this
> behaviour? Scheme and C both allow the above.
> 
> It seems like this would be something that might be nice for certain
> shops to enforce via a compiler switch, but not on by default.
> 
> Ed



More information about the Digitalmars-d mailing list