February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | In article <c1beon$1t16$1@digitaldaemon.com>, John Reimer says... > >> >> >> It's common believe that the "private" for imports is broken. >> >> Did you move the imports to inside the class bodies? >> (of course leave the super class and interfaces out of the class) >> >> That might help (It worked for me) >> it seems to make scope of the >> import the same as any member of the class. >> >> Ant >> > >No, I hadn't tried that yet. Though, after reading some of your experiences, I was planning on doing that but fogot. > >I think Brad tried this already. I'll try it later and see if it helps. Frankly, though, that doesn't seem a very intuitive use of D, unless you can clarify why it works. I won't complain too much if it works, though. > It makes sence to me. If we are going to use the import definition inside the class why declare them outside? I tried to explain how I think it works. It's all speculation. look for a thread where I talk to myself on one post and 2 replies. should have "import" on the subject. (I don't have my new reader here) Ant |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | I did try moving the private import inside the class. I'm trying to think if it was device.d or display.d, moving graphics.gcdata inside. That allowed me to get farther in the compile.
Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it.
BA
John Reimer wrote:
>>
>>
>> It's common believe that the "private" for imports is broken.
>>
>> Did you move the imports to inside the class bodies?
>> (of course leave the super class and interfaces out of the class)
>>
>> That might help (It worked for me)
>> it seems to make scope of the
>> import the same as any member of the class.
>>
>> Ant
>>
>
> No, I hadn't tried that yet. Though, after reading some of your experiences, I was planning on doing that but fogot.
>
> I think Brad tried this already. I'll try it later and see if it helps.
> Frankly, though, that doesn't seem a very intuitive use of D, unless you can clarify why it works. I won't complain too much if it works, though.
>
|
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | > Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it. It might make sense, but why does not having them in the class break it ? And I think this REALLY needs to be documented, and added as a part of the coding style. C On Sun, 22 Feb 2004 18:50:10 -0600, Brad Anderson <brad@sankaty.dot.com> wrote: > I did try moving the private import inside the class. I'm trying to think if it was device.d or display.d, moving graphics.gcdata inside. That allowed me to get farther in the compile. > > Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it. > > BA > > John Reimer wrote: >>> >>> >>> It's common believe that the "private" for imports is broken. >>> >>> Did you move the imports to inside the class bodies? >>> (of course leave the super class and interfaces out of the class) >>> >>> That might help (It worked for me) >>> it seems to make scope of the >>> import the same as any member of the class. >>> >>> Ant >>> >> >> No, I hadn't tried that yet. Though, after reading some of your experiences, I was planning on doing that but fogot. >> >> I think Brad tried this already. I'll try it later and see if it helps. >> Frankly, though, that doesn't seem a very intuitive use of D, unless you can clarify why it works. I won't complain too much if it works, though. >> -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | C wrote: >> Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it. > > > It might make sense, but why does not having them in the class break it ? And I think this REALLY needs to be documented, and added as a part of the coding style. I've convinced (just a gut feeling) this kind of stuff is a compiler bug. But since it only occurs in very complicated situations, it's hard to pare it down to a bug report that Walter will accept. And like John was saying, once I find a work-around I don't feel like complaining as much anymore. > > C -- Justin http://jcc_7.tripod.com/d/ |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | On Sun, 22 Feb 2004 19:01:13 -0800, C wrote:
>> Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it.
>
> It might make sense, but why does not having them in the class break it ? And I think this REALLY needs to be documented, and added as a part of the coding style.
>
>
Yes, it may make sense that it works that way. But it doesn't make sense
that it doesn't work outside of the class, ie. module scope (or perhaps
I'm missing something again). We expect that an integer declared in
module scope will be available to all interior scopes, right? Import
doesn't work that way? That said, I guess I just have learn to treat
import like I would other internal variable declarations. It's preferable
to import within the most global scope that makes use of the imported items.
It's also somewhat foreign to me to see an import statement inside of a class definition. That's likely why I have trouble getting familiar with it. It may be the D way.
I'll get used to it. And, yes, Charles is right. This issue appears to be very common and should be a documented method of object oriented D coding style.
Thanks,
John
|
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | In article <c1bjr6$253e$1@digitaldaemon.com>, J C Calvarese says... > >C wrote: >>> Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and it's not that way in procedural languages, so it's a matter of getting used to it. >> >> >> It might make sense, but why does not having them in the class break it ? And I think this REALLY needs to be documented, and added as a part of the coding style. > >I've convinced (just a gut feeling) this kind of stuff is a compiler bug. But since it only occurs in very complicated situations, No, I have a simple example. (now I know I was really talking to myself on those posts.) Ant |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | On Mon, 23 Feb 2004 01:36:00 +0000, Ant wrote:
>
> No, I have a simple example.
>
> (now I know I was really talking to myself on those posts.)
>
> Ant
:-D
You were, but the monologue was not in vain.
I read some of it. I guess nobody was running it that issue at the time.
|
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | In article <opr3syobatehmtou@localhost>, C says... > >> Ant is right that it makes sense to put the import inside the class if that's where you're going to use it. It's not that way in Java, and = it's not that way in procedural languages, so it's a matter of getting= used to it. > >It might make sense, but why does not having them in the class break it = it's a bug (?) >And I think this REALLY needs to be documented, and added as a part of the coding style. At the time I asked Walter if this was really a feature of the language or some overlooked constraint by dmd. I don't remember getting any answer back. It is (was?) used on phobos. Ant |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | Hehe same here, I went back and read it when i started having the problem ;). C On Sun, 22 Feb 2004 17:39:50 -0800, John Reimer <jjreimer@telus.net> wrote: > On Mon, 23 Feb 2004 01:36:00 +0000, Ant wrote: > >> >> No, I have a simple example. >> >> (now I know I was really talking to myself on those posts.) >> >> Ant > > :-D > > You were, but the monologue was not in vain. > > I read some of it. I guess nobody was running it that issue at the time. > > -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
February 23, 2004 Re: SWT port | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Friesen | Hey andy the link to dbfth is broken do you have a url ? Those delegates are cool i didnt know you could use them like that, seemingly anonymous, almost lambda like! ( this from a person who doesnt know crap about functional ) C On Sun, 22 Feb 2004 14:57:48 -0800, Andy Friesen <andy@ikagames.com> wrote: > John Reimer wrote: >> If the SWT port is of much interest to people, we desperately need >> experienced developers to help work on DWT. Your experience with DUI will >> be particularly invaluable because of all the troubleshooting you've done >> on similar issues already. Even if nobody was really interested in this >> project, Brad and I decided that we would just continue on as best we >> could, and learn as we go. We figured we just won't advertise our work to >> get hopes up unnecessarily. If we get more help, it may actually turn >> into something useful to everyone. > > Is there someplace I can download a snapshot? I wouldn't mind taking a crack at it. > >>> - How automatic did you made the conversion? >> >> No automation currently. It's all done by hand. > > eek. sed is awesome. > > > -- andy -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
Copyright © 1999-2021 by the D Language Foundation