Thread overview | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 01, 2002 final time | ||||
---|---|---|---|---|
| ||||
Hi, I'm very upset with the D language, but the current compiler still misses a few important things (listed on the website, like property gettor/settor, packages, templates,...). Do you have an idea when a more complete version will be available? This would make it much more valuable. |
June 01, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonas | "Jonas" <jonas.vermeulen@student.kuleuven.ac.be> wrote in message news:ada4qv$3029$1@digitaldaemon.com... > Hi, I'm very upset with the D language, but the current compiler still > misses a few important things (listed on the website, like property > gettor/settor, packages, templates,...). > Do you have an idea when a more complete version will be available? > This would make it much more valuable. > > Of course I mean I'm really enthousiastic about the language. I'm sorry for the wrong word choice, strange thought. |
June 01, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonas | "Jonas" <jonas.vermeulen@student.kuleuven.ac.be> wrote in message news:adaj51$i99$1@digitaldaemon.com... > > "Jonas" <jonas.vermeulen@student.kuleuven.ac.be> wrote in message news:ada4qv$3029$1@digitaldaemon.com... > > Hi, I'm very upset with the D language, but the current compiler still > > misses a few important things (listed on the website, like property > > gettor/settor, packages, templates,...). > > Do you have an idea when a more complete version will be available? > > This would make it much more valuable. > > > > > Of course I mean I'm really enthousiastic about the language. I'm sorry for > the wrong word choice, strange thought. The packages are implemented. The templates are not defined and are for version 2 of the language. The property gettors/settors are turning out to be a problem, they may just get dumped. |
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:adb2h9$11qt$1@digitaldaemon.com... > version 2 of the language. The property gettors/settors are turning out to be a problem, they may just get dumped. Please, no! If it seems hard to implement them in the way documented in the reference, then maybe try the C# approach? class Button { private int m_width; public int width { get { return m_width; } set { m_width = value; repaint(); } } } |
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter |
> The packages are implemented. The templates are not defined and are for version 2 of the language. The property gettors/settors are turning out to be a problem, they may just get dumped.
>
>
Though they are not necessary, I would find it a big loss for D it won't be implemented. See the messages about "Any modern language should include properties" and others about them. They are a real pro for D!!
BTW: I agree with some that Delphi is clearer in its syntax.
|
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Ok, ok, I'm just going to have to work harder at this <g>. "Pavel Minayev" <evilone@omen.ru> wrote in message news:adcg51$2imn$1@digitaldaemon.com... > "Walter" <walter@digitalmars.com> wrote in message news:adb2h9$11qt$1@digitaldaemon.com... > > > version 2 of the language. The property gettors/settors are turning out to > > be a problem, they may just get dumped. > > Please, no! > > If it seems hard to implement them in the way documented in the reference, > then > maybe try the C# approach? > > class Button > { > private int m_width; > public int width > { > get > { > return m_width; > } > set > { > m_width = value; > repaint(); > } > } > } > > |
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | On Sun, 2 Jun 2002 11:11:59 +0400, "Pavel Minayev" <evilone@omen.ru> wrote:
>
> Please, no!
>
> If it seems hard to implement them in the way documented in the reference,
> then
> maybe try the C# approach?
>
> class Button
> {
> private int m_width;
> public int width
> {
> get
> {
> return m_width;
> }
> set
> {
> m_width = value;
> repaint();
> }
> }
> }
>
I hadn't seen that syntax before -- much better!
Even better would be to further blur the distinction between data
and functions by not requiring the dummy m_width:
public int width {
// ok to omit get ??
set {
self = value; // two keywords !
repaint ();
}
}
...
|
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karl Bochert | Karl Bochert <kbochert@ix.netcom.com> wrote in news:1103_1023031499@bose:
> Even better would be to further blur the distinction between data and functions by not requiring the dummy m_width:
>
> public int width {
> // ok to omit get ??
> set {
> self = value; // two keywords !
> repaint ();
> }
> }
> ...
How would you access width inside the class wihout calling the function?
|
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Down | On Sun, 2 Jun 2002 16:32:52 +0000 (UTC), Patrick Down <pat@codemoon.com> wrote:
> Karl Bochert <kbochert@ix.netcom.com> wrote in news:1103_1023031499@bose:
>
> > Even better would be to further blur the distinction between data and functions by not requiring the dummy m_width:
> >
> > public int width {
> > // ok to omit get ??
> > set {
> > self = value; // two keywords !
> > repaint ();
> > }
> > }
> > ...
>
> How would you access width inside the class wihout calling the function?
>
1) the absence of a get clause causes the compiler to treat
accesses to width just like any other variable, whether inside
the class or not. Likewise for set of course.
2) In a more general sense, the compiler may in-line both the
get and set functions if they were sufficiently short.
The D documentation says "The compiler makes the decision whether to
inline a function or not...".
|
June 02, 2002 Re: final time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karl Bochert | "Karl Bochert" <kbochert@ix.netcom.com> wrote in message news:1103_1023039833@bose...
> 1) the absence of a get clause causes the compiler to treat
> accesses to width just like any other variable, whether inside
> the class or not. Likewise for set of course.
What about read-only (and write-only) properties then???
Besides, sometimes you just don't need a temporary. For example, the Width property of Button will most likely call MoveWindow to set, and GetWindowRect to get the actual position. Additional variable would be just a waste of space...
|
Copyright © 1999-2021 by the D Language Foundation