View previous topic :: View next topic |
Author |
Message |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue May 25, 2004 4:59 pm Post subject: |
|
|
I'm trying to clean up some of the mess I made in trunk.... So don't be too surprised if you see rapid version jumps for the next little while... |
|
Back to top |
|
|
Blandger
Joined: 21 May 2004 Posts: 50 Location: Ukraine, Kharkov
|
Posted: Tue May 25, 2004 11:02 pm Post subject: |
|
|
JJR wrote: | A question:
Blandger wrote: | Compiler points to:
public abstract class Scrollable : Control {... |
Why is "abstract" being used in the class declaration? |
In the morning I tried make it 'non abstract' it doesn't help either. Nothing changed. Seems it doesn't make difference for compiler.
Now playing with widgets classes, making finer control over 'private imports', moving them outside/inside classes body I'm getting:
f.ref. in the Composite OR in the Srollable OR in the Item OR compiler crash with AV. Does it make sence to send AV dump, stack trace/etc.. to Walter?? I'm afraid it wont' be possible to reproduce such AV on the smaller example.
Last achievement is getting f.ref. error 21 times in the Item.
Now it points to:
Code: | public abstract class Item : Widget { |
Removing 'abstract' doesn't help.
Code: |
.......
dmd -I. -IC:\dmd\src\phobos -version=Win32 -c -ofdwt\graphics\IDrawable.obj dwt\graphics\IDrawable.d
dmd -I. -IC:\dmd\src\phobos -version=Win32 -c -ofdwt\widgets\display.obj dwt\widgets\display.d
dmd -I. -IC:\dmd\src\phobos -version=Win32 -c -ofdwt\widgets\decorations.obj dwt\widgets\decorations.d
dwt\widgets\item.d(27): class Item is forward referenced
........
|
_________________ Regards, Yuriy |
|
Back to top |
|
|
Blandger
Joined: 21 May 2004 Posts: 50 Location: Ukraine, Kharkov
|
Posted: Wed May 26, 2004 4:36 am Post subject: |
|
|
I decided try to compound 'base' widgets classes (widget, composite, control, scrolable, decorations...) leaving only variables and constructors in them, eliminate all dependences from the 'non widgets' classes and 'play' with them.
If I get something interesting I'll write it here and will try to send this package to big W.
What do you think? Did anybody try it before? _________________ Regards, Yuriy |
|
Back to top |
|
|
Blandger
Joined: 21 May 2004 Posts: 50 Location: Ukraine, Kharkov
|
Posted: Wed May 26, 2004 4:37 am Post subject: |
|
|
I decided try to compound 'base' widgets classes (widget, composite, control, scrolable, decorations...) leaving only variables and constructors in them, eliminate all dependences from the 'non widgets' classes and 'play' with them.
If I get something interesting I'll write it here and will try to send this package to big W.
What do you think? Did anybody try it before? _________________ Regards, Yuriy |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed May 26, 2004 7:46 am Post subject: |
|
|
When you ran into trouble compiling Composite and Scrollable modules, did you try compiling those two files together on the same command line to see if it worked?
You may like to try a "manual" compile of these files with one dmd command line statement. Something like:
dmd -c dwt/widgets/composite.d dwt/widgets/scrollable.d
or
dmd -c dwt/widgets/scrollable.d dwt/widgets/composite.d
with the appropriate command line options given (and from the appropriate base directories).
As for compound "base" classes, I'm not quite sure what you mean. I've attempted stripped down versions of the widget classes in trunk. I got fairly good results except that they have yet to be trully tested with more members and methods inserted inside them. |
|
Back to top |
|
|
Blandger
Joined: 21 May 2004 Posts: 50 Location: Ukraine, Kharkov
|
Posted: Wed May 26, 2004 10:57 pm Post subject: |
|
|
JJR wrote: | When you ran into trouble compiling Composite and Scrollable modules, did you try compiling those two files together on the same command line to see if it worked? |
I'll try later though I think the 'main trouble' I (and may be we) ran into is DWT architecture that inherited from SWT. So I try to find out which things bring me to DMD crash or f.ref.
JJR wrote: | As for compound "base" classes, I'm not quite sure what you mean. I've attempted stripped down versions of the widget classes in trunk. I got fairly good results except that they have yet to be trully tested with more members and methods inserted inside them. |
I stripped DWT widgets up to 5 classes. They are widget, scrollable, display, control, composite. Now I can get 3 different results depending on different conditions. There are successful compile, DMD crash, forward reference. I need more time to examine this matter. I think the problems are in them, in their dependences and in their containment.
I have this.
Code: |
module dwt.widgets.widget;
private import dwt.widgets.display;
public abstract class Widget {
//private import dwt.widgets.display;
Display display;
int style;
this() {}
public this(Widget parent, int style) {
this.style = style;
display = parent.display;
}
}
|
Code: |
module dwt.widgets.scrollable;
private import dwt.widgets.control;
//private import dwt.widgets.composite;
public abstract class Scrollable : Control {
private import dwt.widgets.composite;
this() {}
public this(Composite parent, int style) {
// super (parent, style);
}
}
|
Code: |
module dwt.widgets.display;
//private import dwt.graphics.device;
private import dwt.widgets.control;
public class Display { //: Device {
//private import dwt.graphics.device;
//private import dwt.widgets.control;
Control lastHittestControl;
// static Display Default;
public this() {
}
}
|
Code: |
module dwt.widgets.control;
//private import dwt.graphics.IDrawable;
private import dwt.widgets.widget;
//private import dwt.widgets.composite;
public class Control : Widget { // , IDrawable {
private import dwt.widgets.composite;
Composite parent;
this() {}
/+
public this(Composite parent, int style) {
super (parent, style);
this.parent = parent;
}
+/
}
|
Code: |
module dwt.widgets.composite;
private import dwt.widgets.scrollable;
//private import dwt.widgets.control;
public class Composite : Scrollable {
private import dwt.widgets.control;
Control [] tabList;
this() {}
public this(Composite parent, int style) {
super (parent, style);
}
}
|
This combination of classes gets DMD crash. If you move 'private import dwt.widgets.display;' from the outside to the inside 'widget.d' class body you'll get compilation. If you move 'private import dwt.widgets.composite;' in 'control.d' class from the INSIDE to the OUTSIDE body you'll get 'Scrolable forward referenced' 5 times and so on...
I don't know thats the problem with it, but I think the main problem is either DWT architecture or DMD compiler. We must know exactly if DMD can work (and will work later after improvement) in this conditions/architecture or not? What is you opinion, guys?
I need time to check it more carefully. Try to 'play' and check youself.
PS.
Brad, I saw in 'my old copy' of the branch 0.1 there was one unnecessary file. It's a dwt.graphics.drawable. which is identical to the dwt.graphics.IDrawable. _________________ Regards, Yuriy |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Wed May 26, 2004 11:30 pm Post subject: |
|
|
Yuriy,
Once you've checked it more, I would submit it to the D newsgroup and see if anyone has ideas, especially Walter. _________________ I really like the vest! |
|
Back to top |
|
|
Blandger
Joined: 21 May 2004 Posts: 50 Location: Ukraine, Kharkov
|
Posted: Thu May 27, 2004 12:52 am Post subject: |
|
|
brad wrote: | Once you've checked it more, I would submit it to the D newsgroup and see if anyone has ideas, especially Walter. |
Ok, I hope it will take me 2-3 days till I don't have any new ideas. It will be better if you Brad (or other native speaker) will explain this troubles to the newsgroup and Walter.
But ~70-130 forward references mean something bad this time. I don't want to think anything worst about it now, will see. _________________ Regards, Yuriy |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|