Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
March 29, 2003 Attributes: final | ||||
---|---|---|---|---|
| ||||
final is in the list of attributes on <http://www.digitalmars.com/d/attribute.html> but I found nothing else. Is it like Java "final"? -- Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com |
March 29, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | Helmut Leitner wrote:
> final is in the list of attributes on
> <http://www.digitalmars.com/d/attribute.html>
> but I found nothing else.
>
> Is it like Java "final"?
Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point.
|
March 29, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons |
Burton Radons wrote:
>
> Helmut Leitner wrote:
> > final is in the list of attributes on
> > <http://www.digitalmars.com/d/attribute.html>
> > but I found nothing else.
> >
> > Is it like Java "final"?
>
> Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point.
Mmmh. In Java it is also used for variables that can
be set but not reset. A kind of const. IIRC.
--
Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com
|
March 29, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | You do, and I like the concept. Is there nothing similar in D? Should be, if not "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3E85F16F.3C55EEAF@chello.at... > > > Burton Radons wrote: > > > > Helmut Leitner wrote: > > > final is in the list of attributes on > > > <http://www.digitalmars.com/d/attribute.html> > > > but I found nothing else. > > > > > > Is it like Java "final"? > > > > Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point. > > Mmmh. In Java it is also used for variables that can > be set but not reset. A kind of const. IIRC. > > -- > Helmut Leitner leitner@hls.via.at > Graz, Austria www.hls-software.com |
March 30, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | Add another vote for that, please... (The name could be something better, though.) Luna Kid "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:b657ur$d4d$1@digitaldaemon.com... > You do, and I like the concept. > > Is there nothing similar in D? Should be, if not > > "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3E85F16F.3C55EEAF@chello.at... > > > > > > Burton Radons wrote: > > > > > > Helmut Leitner wrote: > > > > final is in the list of attributes on > > > > <http://www.digitalmars.com/d/attribute.html> > > > > but I found nothing else. > > > > > > > > Is it like Java "final"? > > > > > > Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point. > > > > Mmmh. In Java it is also used for variables that can > > be set but not reset. A kind of const. IIRC. |
March 30, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luna Kid | "Luna Kid" <lunakid@neuropolis.org> wrote in message news:b65o3b$o85$1@digitaldaemon.com... > Add another vote for that, please... > (The name could be something better, though.) > > Luna Kid I also like the idea. Here are some naming ideas: invar (invariable) unvar (unvary) persist (persistent) dconst (dynamic constant) rconst (runtime constant) personally I prefur persist. > "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:b657ur$d4d$1@digitaldaemon.com... > > You do, and I like the concept. > > > > Is there nothing similar in D? Should be, if not > > > > "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3E85F16F.3C55EEAF@chello.at... > > > > > > > > > Burton Radons wrote: > > > > > > > > Helmut Leitner wrote: > > > > > final is in the list of attributes on > > > > > <http://www.digitalmars.com/d/attribute.html> > > > > > but I found nothing else. > > > > > > > > > > Is it like Java "final"? > > > > > > > > Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point. > > > > > > Mmmh. In Java it is also used for variables that can > > > be set but not reset. A kind of const. IIRC. > > |
March 30, 2003 Re: Attributes: final | ||||
---|---|---|---|---|
| ||||
Posted in reply to anderson | "anderson" <anderson@badmama.com.au> wrote in message news:b67g8g$1rhu$1@digitaldaemon.com... > "Luna Kid" <lunakid@neuropolis.org> wrote in message news:b65o3b$o85$1@digitaldaemon.com... > > Add another vote for that, please... > > (The name could be something better, though.) > > > > Luna Kid > > I also like the idea. Here are some naming ideas: > > invar (invariable) > unvar (unvary) > persist (persistent) > dconst (dynamic constant) > rconst (runtime constant) > > personally I prefur persist. > Sorry dude, but it's yuck! to all of them. I'd rather use final. At least it has a relatively well-known history. I really hate persist, since who know's whether we may have some mechanism in D in the future to automatically persist objects, in which case this keyword would very likely be needed for that. > > "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:b657ur$d4d$1@digitaldaemon.com... > > > You do, and I like the concept. > > > > > > Is there nothing similar in D? Should be, if not > > > > > > "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3E85F16F.3C55EEAF@chello.at... > > > > > > > > > > > > Burton Radons wrote: > > > > > > > > > > Helmut Leitner wrote: > > > > > > final is in the list of attributes on > > > > > > <http://www.digitalmars.com/d/attribute.html> > > > > > > but I found nothing else. > > > > > > > > > > > > Is it like Java "final"? > > > > > > > > > > Yeah, a method that cannot be overloaded. The method can often be inlined as well; I use it for that and for methods which should be overloaded at a different point. > > > > > > > > Mmmh. In Java it is also used for variables that can > > > > be set but not reset. A kind of const. IIRC. > > > > > > |
Copyright © 1999-2021 by the D Language Foundation