Static Functions and pointers

Kirk McDonald kirklin.mcdonald at gmail.com
Tue Apr 3 14:55:14 PDT 2007


Dan wrote:
> Kirk McDonald Wrote:
> 
>>No, it means you *can* use that. 
> 
> ...
> 
> The rest didn't make sense.  : p  Classes are still little black boxes to me, I think well in terms of instructions, pointers, structs and arrays.
> 
> So that means I can now go:
> 
> static int f1(int x){..}
> static int f2(int x){..}
> static int f3(int x){..}
> 
> static int function(int x)[3] foo = [ &f1, &f2, &f3 ];
> 
> ???
> 
> If that's true, then that will dramatically improve startup performance and legibility of my Walnut 2.x scripting engine!  : D

Note that 'static' at module scope does exactly nothing. There's no 
difference between a static global function and a regular global 
function. (I mentioned classes because, in seeing 'static', I had 
assumed you were talking about classes.)

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org


More information about the Digitalmars-d-learn mailing list