|
![](/i/fill.gif) |
In article <403a8d68@news.povray.org>, Warp <war### [at] tag povray org>
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] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |