POV-Ray : Newsgroups : povray.unofficial.patches : POV+for() : Re: POV+for() Server Time
2 Nov 2024 17:20:56 EDT (-0400)
  Re: POV+for()  
From: J  Grimbert
Date: 6 May 1999 09:27:09
Message: <37318A93.1EDBF5BF@atos-group.com>
TonyB wrote:
> 
> > The ++ is called the increment operator.
> > The -- is called the decrement operator.
> >
> > I don't see a burning need for these since they just add or subtract
> > one from the variable.
> 
> I see them as helpful in speeding up the parsing. Less text = less
> parsing (no?)

Not really, for instance the famous tree macro is short, and it take
ages to parse.
Parsing is not only reading the scene file, it's also creating the
memory representation of the scene.
If I were to agree with less text == less parsing, you have to remove
all
the comments, and all the blank lines (Wait, that's an idea, let's
remove
the carriage return/line feed : the one-line pov-scene !)

> 
> > There may be a use for *= and other compound operators, but still the
> > long version of what these accomplish gets the job done.
> 
> But it looks ugly.

Exactly what I thought on the first post: you are asking for cosmetic
changes.

<Extrem on>
 I would like the removal of sqrt(), instead you have to write 
   2^(1/2)   (or 2**0.5 ?)

 It's more like the formula in my math books. (fortran book ?)
<Extrem off>

> 
> > Regarding the for() loop, I usually just use this as an incrementing
> > loop anyhow which can be accomplished with the while loop by adding
> > an incrementer at the end. ie:
> 
> Your code was interesting, I've never done that. But still, the for would
> look neater, and is easier to write, at least for me.

It's just a cosmetic change.
Now, you can try to define a for() #macro for your personal usage.
something like:
#macro for(start,cond,inc,block)
start
#while(cond)
block
inc
#end
#end


Nota: I'm not sure this macro would ever work, or is even possible
Maybe it could be the real winner of the useless macro competition
(probably a higher complexity would help to gain some points...)


Post a reply to this message

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