Re: Static function at module level

2014-08-18 Thread bearophile via Digitalmars-d-learn
ketmar: other function declarations (methods, nested functions) accepts 'static', so why free functions shouldn't? For various reasons, one of them is that accepting useless code confuses newbies and doesn't allow them to build a correct model of the D semantics in their head. Bye,

Re: Static function at module level

2014-08-18 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Aug 18, 2014 at 06:46:02AM +, bearophile via Digitalmars-d-learn wrote: ketmar: other function declarations (methods, nested functions) accepts 'static', so why free functions shouldn't? For various reasons, one of them is that accepting useless code confuses newbies and

Re: Static function at module level

2014-08-18 Thread bearophile via Digitalmars-d-learn
H. S. Teoh: Is there a bug filed for this? Probably there is. But I stopped filing similar bugs because they seem to have a very low priority. Bye, bearophile

Re: Static function at module level

2014-08-18 Thread Phil Lavoie via Digitalmars-d-learn
On Monday, 18 August 2014 at 06:46:03 UTC, bearophile wrote: ketmar: other function declarations (methods, nested functions) accepts 'static', so why free functions shouldn't? For various reasons, one of them is that accepting useless code confuses newbies and doesn't allow them to build a

Re: Static function at module level

2014-08-18 Thread Phil Lavoie via Digitalmars-d-learn
): static void myFunc() {} What is a static function at module level exactly? In C, that means private, in D, that means ___? I'm pretty sure that it means nothing. It's just one of those cases where an attribute is ignored, because it doesn't apply rather than resulting in an error

Re: Static function at module level

2014-08-18 Thread Phil Lavoie via Digitalmars-d-learn
On Monday, 18 August 2014 at 14:23:47 UTC, bearophile wrote: H. S. Teoh: Is there a bug filed for this? Probably there is. But I stopped filing similar bugs because they seem to have a very low priority. Bye, bearophile I looked around for it but didn't find it. I filed this one:

Re: Static function at module level

2014-08-18 Thread ketmar via Digitalmars-d-learn
On Mon, 18 Aug 2014 06:46:02 + bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: accepting useless code confuses newbies i think that i'm not really a newbie now ;-), but i'm still used to declare various private module functions and variables as 'static'. yes,

Re: Static function at module level

2014-08-18 Thread Phil Lavoie via Digitalmars-d-learn
On Monday, 18 August 2014 at 17:42:37 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 18 Aug 2014 06:46:02 + bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: accepting useless code confuses newbies i think that i'm not really a newbie now ;-), but i'm still

Re: Static function at module level

2014-08-18 Thread ketmar via Digitalmars-d-learn
On Mon, 18 Aug 2014 17:55:01 + Phil Lavoie via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I don't think he meant you personally. ah, nothing personal, i just described my use case, maybe using some vague wording. i AM a newbie in D, there is nothing insulting in being

Static function at module level

2014-08-17 Thread Phil Lavoie via Digitalmars-d-learn
Ok, so after years of D usage I just noticed that this is valid D (compiles anyways): static void myFunc() {} What is a static function at module level exactly? In C, that means private, in D, that means ___? Thanks, Phil

Re: Static function at module level

2014-08-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Mon, 18 Aug 2014 01:32:40 + Phil Lavoie via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Ok, so after years of D usage I just noticed that this is valid D (compiles anyways): static void myFunc() {} What is a static function at module level exactly? In C, that means

Re: Static function at module level

2014-08-17 Thread ketmar via Digitalmars-d-learn
On Mon, 18 Aug 2014 01:32:40 + Phil Lavoie via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What is a static function at module level exactly? In C, that means private, in D, that means ___? nothing. static attribute for free function has no special meaning