POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 14:24:06 EDT (-0400)
  Re: Object Oriented POV code  
From: Christopher James Huff
Date: 21 Feb 2004 15:15:09
Message: <cjameshuff-14F32E.15155021022004@news.povray.org>
In article <4037b30f@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> Christopher James Huff <cja### [at] earthlinknet> wrote:
> > def ColoredSphere: derive sphere {
> 
>   Is 'derive' any common OO term?
> 
>   The keyword I personally would like the most would be 'is_a', even
> though I can be happy with just 'inherits'.

Subclasses are often called derived classes. And "inherits" doesn't seem 
to fit as well...ColoredSphere doesn't inherit sphere, it inherits from 
sphere. And is_a seems to fit better as a boolean:

if(ColoredSphere is_a sphere)
    ...do something...

Or you could do what java does, and use "extends", but that doesn't 
really fit with what I wrote, which declares the class as a value. Maybe 
"extend" would work, but it seems too close to "extends", people coming 
from Java would mistype it a lot. Of course, you could eliminate the 
keyword altogether:

class ColoredSphere: sphere {...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.