POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 08:23:07 EDT (-0400)
  Re: Object Oriented POV code  
From: Warp
Date: 19 Feb 2004 13:41:55
Message: <40350372@news.povray.org>
Dan P <dan### [at] yahoocom> wrote:
> I see what you're thinking of on this. I think it is there for clarity -- 
> the compiler could always check to see what has been defined and decide to
> either create a  new class there or use the reference.

  The reference to what?
  The thing after 'new' is a type. How can you make a reference to a type?
Where should the reference point to?

  You can make your scripting language interpreter so that instances are
always created dynamically for simplicity (that way you don't have to
make the distinction between a local variable and a reference because
everything is a reference, like in Java). However, the 'new' keyword
does not contribute anything to this. It's obsolete and can be
completely left out without the expressive power of the language
being degraded.

  Have you ever wondered why you are not forced to define all your
objects in POV-Ray inside object{} blocks, why you are not forced to
put all your material and texture statements into material{} and
texture{} blocks, etc?
  Because forcing the user to write something unnecessary is only
a burden, not a help.

  Even more, object{}, material{} and texture{} are sometimes necessary.
However, I can't imagine a situation where 'new' would be necessary
(assuming we are dealing with a language where all class instances
are created dynamically, as in Java).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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