POV-Ray : Newsgroups : povray.pov4.discussion.general : Identifier declaration consistent with other languages : Re: Identifier declaration consistent with other languages Server Time
2 May 2024 20:15:13 EDT (-0400)
  Re: Identifier declaration consistent with other languages  
From: Allen
Date: 5 Nov 2008 15:25:00
Message: <web.4911ffd2909e69788f162dfb0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Chambers <ben### [at] pacificwebguycom> wrote:
> > Instead of
>
> > #declare myobj = object {
>
> > Why not use
>
> > object myobj {
>
>   The intention is to redesign the SDL for pov4 anyways. What we need is
> a good overall design rather than just individual bits.
>
> --
>                                                           - Warp

I'd like to see more powerful scripting support as well.  I use Python
frequently to generate POV-ray code.

An a syntax change:

Instead of

#declare count = 10
#declare pos = 0
#declare MyObject = union {
  #while(pos < count)
  circle {
    <0, 0, 5>, 0.5
    rotate <0, pos * 360 / count, 0>
    texture {
      pigment {
        #if(pos % 2 == 0)
          color White
        #else
          color Black
        #end
      }
    }
  }
  #declare pos = pos + 1
  #end
}

Why not simply have:

count = 10
MyObject = union {
  for(pos = 0, pos < count, pos = pos + 1) {
    circle {
      <0, 0, 5>, 0.5
      rotate <0, pos * 360 / count, 0>
      texture {
        pigment {
          if(pos % 2 == 0) {
            color White
          } else {
            color Black
          }
        }
      }
    }
  }
}


MyMacro = macro(p1, p2, p3) {
  /* Macro body */
}

MyMacro(x, y, z)


Post a reply to this message

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