www.digitalmars.com         C & C++   DMDScript  

D - Attributes: final

reply Helmut Leitner <helmut.leitner chello.at> writes:
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
Mar 29 2003
parent reply Burton Radons <loth users.sourceforge.net> writes:
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.
Mar 29 2003
parent reply Helmut Leitner <helmut.leitner chello.at> writes:
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
Mar 29 2003
parent reply "Matthew Wilson" <dmd synesis.com.au> writes:
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
Mar 29 2003
parent reply "Luna Kid" <lunakid neuropolis.org> writes:
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.
Mar 29 2003
parent reply "anderson" <anderson badmama.com.au> writes:
"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.
Mar 30 2003
parent "Matthew Wilson" <dmd synesis.com.au> writes:
"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.
Mar 30 2003