POV-Ray : Newsgroups : povray.advanced-users : Allowing reserved keywords to be used as identifier names? : Re: Allowing reserved keywords to be used as identifier names? Server Time
28 Jul 2024 18:22:13 EDT (-0400)
  Re: Allowing reserved keywords to be used as identifier names?  
From: Thorsten Froehlich
Date: 31 May 2004 16:12:27
Message: <40bb91ab@news.povray.org>
In article <40bb852b$1@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> This is a guess from the top of my head.

Wait, this example can be solved by just determining if there is an even or
odd number of "blue", but I was looking for an example that requires
counting (informal rationale: if counting is required, the language is not
context-free).  One needs to use a second color component specifier to
create the need for counting:

#declare sp1 = sphere
{
 z*10,1
 texture
 {
  pigment
  {
   color
   #declare blue = 0;
   blue
   #declare blue = 1;
   #declare red = 1;
   red
   red
   red
   blue
   red
   blue
   blue
   blue
   blue
   blue
  }
 }
}

#declare sp2 = sphere
{
 z*10,1
 texture
 {
  pigment
  {
   color
   #declare blue = 0;
   blue
   #declare blue = 1;
   #declare red = 1;
   blue
   red
   blue
   red
   red
   blue
   red
   red
   red
   blue
   blue
   blue
   blue
   red
  }
 }
}



____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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