P.S. If it doesn’t actually do anything, I wonder if something like the behaviour of “static import” would be desirable?
Can anyone point me to a part of the D spec that says what
`static` means when applied to functions that are declared at
module scope? (Other than module constructors, obviously)
I used to assume the property would do something, so I actually
used it in a lot of my code when I was first learning D. Now
someone I work with who’s newer to the language is now also going
through this phase. The assumption of both me and them was that a
static module-level function would more-or-less work like a
function with `pragma(inline, true)`, which makes more sense if
you overlook how `static` usually applies to *functions* and you
instead look at how `static` applies to almost everything else:
variables (their initialisation is compile-time), `if`,
`foreach`, and `assert`. However, I haven’t seen *anything* to
suggest that `static` even does anything at all in this case; it
also doesn’t give you a compiler error or even a warning, is it
like this to make automatic code generation easier, or does it
actually do something? Maybe D’s spec could be tweaked to make
this a bit clearer? On quite a few occasions I’ve searched for
info about this and found nothing relevant.
- `static` on modu... IchorDev via Digitalmars-d-learn
- Re: `static... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn