Re: @disable

2010-01-16 Thread Michal Minich
On Sat, 16 Jan 2010 00:58:36 -0600, Andrei Alexandrescu wrote: > I'd also like to see other keywords (nothrow, pure, override come to > mind) transferred into the attribute space. I'd welcome if that happens. My personal favorite is "align", it is common, hard to replace word when one works with

Re: @disable

2010-01-16 Thread Pelle Månsson
On 01/16/2010 01:46 AM, Leandro Lucarella wrote: Ali Çehreli, el 15 de enero a las 16:01 me escribiste: http://www.digitalmars.com/d/2.0/declaration.html#AutoDeclaration It is news to me that the following works without 'auto': struct S { int i; this(int i) { this.i =

Re: @disable

2010-01-16 Thread Robert Clipsham
On 15/01/10 00:36, Leandro Lucarella wrote: Yes, I can read, but I wondered what's the point on making a function non-callable. It's absolutely contradictory! :) Other than the no-copy idiom for structs, I'd find it useful in the following situation: @disable void foo1() { } int foo2( i

Re: Private default function arguments

2010-01-16 Thread Robert Clipsham
On 15/01/10 08:25, bearophile wrote: int foo3(int x, private int depth=0) { ... foo3(x+1); // OK foo3(x, depth + 1); // OK ... } void main() { int r = foo3(5); // OK int r = foo3(5, 1); // Error int r = foo3(5, 0); // Error } Does this not achieve the same effect? (OK, the

Re: Private default function arguments

2010-01-16 Thread Jérôme M. Berger
Robert Clipsham wrote: > On 15/01/10 08:25, bearophile wrote: >> int foo3(int x, private int depth=0) { >>... >>foo3(x+1); // OK >>foo3(x, depth + 1); // OK >>... >> } >> void main() { >>int r = foo3(5); // OK >>int r = foo3(5, 1); // Error >>int r = foo3(5, 0); // Error

Re: @disable

2010-01-16 Thread Ary Borenszweig
Pelle Månsson wrote: On 01/16/2010 01:46 AM, Leandro Lucarella wrote: Ali Çehreli, el 15 de enero a las 16:01 me escribiste: http://www.digitalmars.com/d/2.0/declaration.html#AutoDeclaration It is news to me that the following works without 'auto': struct S { int i; this(int i)

Re: @disable

2010-01-16 Thread Leandro Lucarella
Pelle Månsson, el 16 de enero a las 14:00 me escribiste: > >I don't think so. auto means in D the same that in C/C++, the difference > >is that D do type inference when a *storage class* is given. const, > >static, immutable, shared are other storage classs, so when you used > >them, you can infer

Re: @disable

2010-01-16 Thread Andrei Alexandrescu
Michal Minich wrote: On Sat, 16 Jan 2010 00:58:36 -0600, Andrei Alexandrescu wrote: I'd also like to see other keywords (nothrow, pure, override come to mind) transferred into the attribute space. I'd welcome if that happens. My personal favorite is "align", it is common, hard to replace wor

Attribute Keywords [was Re: @disable]

2010-01-16 Thread Jesse Phillips
Michal Minich wrote: > On Sat, 16 Jan 2010 00:58:36 -0600, Andrei Alexandrescu wrote: > >> I'd also like to see other keywords (nothrow, pure, override come to >> mind) transferred into the attribute space. > > I'd welcome if that happens. My personal favorite is "align", it is > common, hard to

Re: @disable

2010-01-16 Thread Jesse Phillips
Ary Borenszweig wrote: > Why not read the specification? > > http://www.digitalmars.com/d/2.0/attribute.html#auto > > "The auto attribute is used when there are no other attributes and type > inference is desired." > > So basically type inference is always done except when you specify the type.

Re: @disable

2010-01-16 Thread Ali Çehreli
Leandro Lucarella wrote: I think auto just means inferred type. That seems to be the case then... So Ali Çehreli was right and I was wrong. Oh no... I had already adopted your thinking. :) I still like my logic better, I will keep thinking that auto is a real storage class and ignore this

Re: Private default function arguments

2010-01-16 Thread Robert Clipsham
On 16/01/10 14:39, "Jérôme M. Berger" wrote: Two words: stack overflow. Even if you fix your function to avoid the stack overflow, this would fail in multithread environments (or be too slow if depth is made thread local). Jerome Ah, thanks :) Seems in my simple single

A penny of oppression is OK?

2010-01-16 Thread Ashok
Making money off of the toils of many. To be lost? I assure you at least I am watching. "make money off of the masses"... surely you are a crime against humanity. M.O.: a penny of oppression, no one will notice. Take your "tea" (surely it happened before that), and SHOVE IT UP YOUR ASS.