December 15, 2001 forward references | ||||
---|---|---|---|---|
| ||||
Their implementation in D seems unclear to me. On one hand, they are allowed - at least in alpha: int function(int n); // works! On other hand, they don't serve any practical meaning - D doesn't need them anyhow, and there is no way to define a body once the prototype was declared: int function(int n) { } // symbol conflict So what are they for? |
December 16, 2001 Re: forward references | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:9vgete$138v$1@digitaldaemon.com... > Their implementation in D seems unclear to me. > On one hand, they are allowed - at least in alpha: > > int function(int n); // works! > > On other hand, they don't serve any practical meaning - > D doesn't need them anyhow, and there is no way > to define a body once the prototype was declared: > > int function(int n) { } // symbol conflict > > So what are they for? They're for if you really do want to create a library with a hidden implementation of the functions. The way to do it would be make a copy of the module, and delete the function bodies. |
Copyright © 1999-2021 by the D Language Foundation