POV-Ray : Newsgroups : povray.programming : Object oriented POV scene language? : Re: Object oriented POV scene language? Server Time
28 Jul 2024 16:17:39 EDT (-0400)
  Re: Object oriented POV scene language?  
From: Warp
Date: 24 Jul 2000 05:47:02
Message: <397c1096@news.povray.org>
David <dav### [at] maccom> wrote:
:> Uh, ever hear of structs?
:     Can a struct have functions as well is vars? Can a struct have protected
: members? Can a struct have inheritance? Are structs encapsulated? Ect.

  The fact that the language doesn't directly support modules (and that's
what we are talking about here; you have so far mentioned no truely OO
programming feature) it doesn't mean that you can't use structures as if
they were modules.
  You can have member variables and member functions (either you just call
the proper function giving the struct as parameter, as C++ internally does,
or you put function pointers inside the struct).
  This, of course, looks ugly, but when used properly it makes little
difference compared to a truely modular language (like C++).

  And I would like to emphasize that you keep talking about object-oriented
programming, and still you haven't mentioned ANY feature of object-oriented
languages (inheritance, dynamic binding, overloading...). You just keep
talking about modules.
  For your information, the povray source code even uses some kind of
inheritance (and even dynamic binding, I think), which makes it very OO-like.
It looks ugly in C, but it does it.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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