POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 08:17:41 EDT (-0400)
  Re: Object Oriented POV code  
From: Christopher James Huff
Date: 23 Feb 2004 19:05:31
Message: <cjameshuff-6D99E8.19061623022004@news.povray.org>
In article <403a8d68@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> > No...then you declare a reference to it. For example, Sapphire has two 
> > forms of the syntax for declaring variables:
> 
>   What if you want to make your class secure so that the user can't
> break it?
>   This may happen by accident (ie. the user doesn't realize what he
> is doing), not necessarily by a malign coder.

Then don't return a direct reference. You could return a proxy that 
doesn't implement modification operations, but otherwise behaves like 
the object referred to. You get the benefits of returning a member 
without a long copy operation, and that member is still protected from 
modification. Of course, this is basically doing what language-level 
constant references would do, and isn't much simpler...


> > And it does complicate the language. Remember that this is a scene 
> > description language...
> 
>   That doesn't mean it shouldn't be made secure.

It does mean it should be made as simple as feasible. Lack of constants 
hasn't done much harm in POV-Ray.

-- 
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.