Thread overview | |||||
---|---|---|---|---|---|
|
February 15, 2007 Idea for ported java static this? | ||||
---|---|---|---|---|
| ||||
I am porting Java code with a converter. Java is different from D in many things. One of the problems is the static initialization of classes. If i would add a "static this()" to every ported class, i would end up in terrible 'cyclic dep' trouble. So I decided to add a "public static static_this()" method to each class, and generate a single file, that contains all calls to these methods. I can edit the sequence. So it works, no problem so far. Problem with this solution is, that this means, that all existing classes are pulled in and the application size will grow. How can i make sure, all static_this from linked in modules are called, without having all modules forces to link in? Something like a weak link-in ref :) Any ideas? |
February 15, 2007 Re: Idea for ported java static this? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Benoit (keinfarbton) | Frank Benoit (keinfarbton) wrote:
> How can i make sure, all static_this from linked in modules are called,
> without having all modules forces to link in? Something like a weak
> link-in ref :)
There's no way to do it now. But this should be possible with future runtime reflection stuff.
|
February 15, 2007 Re: Idea for ported java static this? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | > There's no way to do it now. But this should be possible with future runtime reflection stuff.
Ok, good to know.
|
Copyright © 1999-2021 by the D Language Foundation