POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 08:24:17 EDT (-0400)
  Re: Object Oriented POV code  
From: Christopher James Huff
Date: 23 Feb 2004 18:22:39
Message: <cjameshuff-1806B5.18232323022004@news.povray.org>
In article <40394cee@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> Christopher James Huff <cja### [at] earthlinknet> wrote:
> > > Int foo = container.size(); // <- gets a *reference*
> 
> > No, that initializes an Int named foo to the object returned by 
> > container.size. Not a problem.
> 
>   And what if you *do* want a reference to the member variable?
> You can't?

No...then you declare a reference to it. For example, Sapphire has two 
forms of the syntax for declaring variables:

def foo: bar; //declares foo as a reference to bar

def foo = bar; //declares foo as a reference to a copy of bar


> > You could also introduce const references...not sure if its worth the 
> > trouble.
> 
>   I think they are useful, as I mentioned above.
>   Don't know what would be a practical syntax, though.

And it does complicate the language. Remember that this is a scene 
description language...

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