POV-Ray : Newsgroups : povray.pov4.discussion.general : POV-Ray 4 SDL: Some concrete proposal : Re: POV-Ray 4 SDL: Some concrete proposal Server Time
3 Dec 2024 23:10:11 EST (-0500)
  Re: POV-Ray 4 SDL: Some concrete proposal  
From: clipka
Date: 13 Apr 2009 16:40:00
Message: <web.49e3a2023a7e550e2dae03a10@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> > SphereCenter = <0,1,0>;
>
> > sphere {
> >   center: SphereCenter;
> >   radius: 1 as SphereRadius;
> >   texture {
> >     pigment { color: #<1,0,0> }
> >   };
> > } as MainSphere;
>
>   I find that rather inconsistent.
>
>   First you use "name = value" to define a vector, but then you use
> "value as name" to define an object.
>
>   What's wrong with using "MainSphere = sphere { ... };"? That would make
> it consistent and closer to the current SDL. You also save a useless
> reserved keyword.

Nothing - I jsut wanted to show two different ways of doing things. Probably
dind't make it plain enough.

Both the following would be valid statements:

  MainSphere = sphere { ... };
  sphere { ... } as MainSphere;

with the difference that the former would not automatically add it to the scene,
just create a prototype.

> > modify MainSphere {
> >   radius: 0.9;
> > };
>
>   I'm not sure about that syntax, but IMO it should be at least in addition
> to a syntax like:
>
> MainSphere.radius = 0.9;
>
>   The dot syntax is intuitive from many languages (including the current
> SDL itself), and can be used as an lvalue and an rvalue, an example of the
> latter being:

Um... where in the current SDL is that notation used? I mean, other than vector
(and color vector) components?

N.B. That syntax would also be available; however, the "modify" type of notation
would allow for a more concise tampering with multiple values of a single
object.

I'd find it inconsistent to be able to modify a freshly created object in such a
way, but not an existing one.


Post a reply to this message

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