POV-Ray : Newsgroups : povray.general : The Language of POV-Ray Server Time
4 Dec 2026 02:26:48 EST (-0500)
  The Language of POV-Ray (Message 18 to 67 of 297)  
<<< Previous 17 Messages Goto Latest 50 Messages Next 50 Messages >>>
From: Johannes Hubert
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 13:28:58
Message: <38c7ed6a@news.povray.org>
"ingo" <ing### [at] homenl> wrote in message
news:8EF2B8E07seed7@204.213.191.228...
> Nieminen Juha wrote:
>
> >#declare A += B;
> >#declare A -= B;
>
> What does it mean?

the same as

#declare A = A + B;
#declare A = A - B;

Johannes.


Post a reply to this message

From: Jerry
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 14:07:08
Message: <jerry-54B241.11070809032000@news.povray.org>
In article <38C7685C.5A4F3A68@pacbell.net>, lin### [at] povrayorg 
wrote:
>Would you have difficulty re-learning POV-Ray if it's language format
>changed ?
>
>Would you resent it or maybe even quit using the program completely ?

If it's better and easier to use, I keep using it; if it's not, I don't. 
Personally, I like the template-scripting style of POV, much for the 
same reason I really like PHP for making web pages.

If I were to make one change to the language, it might be to make a form 
of macro that looks more like built-in functions. So instead of making a 
function like:

#macro FaceofGod(Religion,Sect,Vowels)

#end

and calling it like:

object { FaceofGod("Christianity","Mormon","auau")}

you could call it like:

FaceofGod {
   religion "Christianity"
   sect "Mormon"
   vowels "auau"
   pigment {
      color Green
   }
}

But this might be solved by object-oriented objects as well.

Jerry


Post a reply to this message

From: Ken
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 14:08:09
Message: <38C7F72E.4C89096D@pacbell.net>
Johannes Hubert wrote:
> 
> "ingo" <ing### [at] homenl> wrote in message
> news:8EF2B8E07seed7@204.213.191.228...
> > Nieminen Juha wrote:
> >
> > >#declare A += B;
> > >#declare A -= B;
> >
> > What does it mean?
> 
> the same as
> 
> #declare A = A + B;
> #declare A = A - B;

So the way I see it by adding this you would save yourself the effort
of typing one character. The question the potential patch writer must
ask himself then is if it be worth the effort to patch the program to
accept this new style of arguement just to save the user from having
to type one more character into their scene file. Reduced to this it
would seem a petty feature.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 14:13:26
Message: <38c7f7d6$1@news.povray.org>
On Thu, 09 Mar 2000 11:10:38 -0800, Ken wrote:

>So the way I see it by adding this you would save yourself the effort
>of typing one character.

#declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 14:14:15
Message: <38c7f807$1@news.povray.org>
On 9 Mar 2000 14:13:26 -0500, Ron Parker wrote:
>On Thu, 09 Mar 2000 11:10:38 -0800, Ken wrote:
>
>>So the way I see it by adding this you would save yourself the effort
>>of typing one character.
>
>#declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;

er, .red, that is.  Grr..


-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Josh English
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 15:29:51
Message: <38C80A7B.46BD59EB@spiritone.com>
This is what I'm looking for. I'm no programmer either, but if you ever publish
anyhting on it please post it here or let me know (yeah, that's asking a lot, I
realize) but this is exactly the kind of thing I would want POV-Ray to be able to
do.

Josh

Mikael Carneholm wrote:

> Ken,
>
> I feel the need to make a contribution to the debate here, as I have been
> involved in the discussion of changing the POV syntax and am about to submit a
> proposal to a new POV-Ray language (PRL?), as a part in the making of my
> Masters of Arts essay. My intention (and purpose with the research part) is to
> investigate if it is possible to keep backwards compatibility when re-defining
> a programming language (in this case: PRL or POV-Script as we know it). This
> will consequently be my mission - to develop a language that is powerful when
> you need it, yet easy to use if you're not a programming expert.
>
> The OO-approach comes somewhat naturally as I see it, as the world in POV-Ray
> consists of just that - objects. The spheres, cubes, cylinders, etc. that we
> describe are all representations of physical objects. We already have the
> object{[object identifier]}keyword, and the #declare MyThingy = sphere{..} is
> equivalent to a class description.
>
> I think I have mentioned this before, but I might as well say it again: The
> new POV-script I am thinking of is fully backwards compatible i.e. you should
> still be able to just describe a scene in no particular order, just as you
> always have. Some OO-features will hopefully be possible, but you will not
> have to write #declare MySphere1 = new sphere(<0,0,0>, new size(0.5), new
> texture(new pigment(color new vector(<1,1,1>))))); or something as
> (java-)horrible as that to create a white sphere. But, you should be able to
> access the attributes of the objects in the scene, for example: #declare
> camera.location = MySphere1.location - <0,0,5>;
>
> I'm very open for suggestions, as I'm merely a POV user and we (the POV users)
> should collaborate to keep POV as the best free raytracer available.
>
> - Mikael.
>
> ----------------------------------------------------
> Mikael Carneholm
> Dep. of Computer Science and Business Administration
> UCB (University College of Borås) Sweden
>
> Personal homepage:
> http://www.studenter.hb.se/~arch
> E-mail:
> sa9### [at] idautbhbse

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Remco Poelstra
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 15:41:38
Message: <38C861AB.74707CBC@home.nl>
> Would you have difficulty re-learning POV-Ray if it's language format
> changed ?
> 
> Would you resent it or maybe even quit using the program completely ?
> 
No, I wouldn't have difficulty with re-learning POV-Ray, except that I
can be hard, if you have finally find out how to create something and
you have to do that research again.
I would never resent POV-Ray completly, because I like that it's free
and that texture are created by the program and that it are no photo's.
The only thing  that I'm missing is advanced animation (like objects
bouncing automatically and complex movements).

Remco Poelstra


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 16:30:06
Message: <38C816BE.35E35A1C@hotmail.com>
Hi

But what if the loop control variable is a vector that is shared
between several nested loops? (See my example macro below.)

Would this be possible with nested for-loops?

Regards

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


PoD wrote:

> Some aspects of the language which relate purely to programming could be
> changed or (probably better) extended without affecting those who don't
> use them.
>
> For a non-programmer or a programmer , macros, loops etc are a lot
> harder in POV than the equivalents in most programming languages.
>
> Surely replacing
>   #declare I=1; #while(I<=5) ... #declare I=I+1;#end
> with either
>   for I = 1 to 5 {...}
> ala Basic, or even for a non-programmer,
>   for( I=1; I <= 5; I=I+1){...}
> would make life easier for all.
>
> PoD.

#macro ObjectSplit(Thing, Point1, Point2, nnv)
// Cuts an object into several "box"-parts
// Result is returned in an array of such parts

  //#local nnv = <nx, ny, nz>;
  #local ThingArray = array[nnv.x][nnv.y][nnv.z]
  #local dPoint = (Point2 - Point1)/nnv;

  #local Cntv = Nullv;
  #while (Cntv.z < nnv.z)
    #local Cntv = Cntv*z;
    #while (Cntv.y < nnv.y)
      #local Cntv = Cntv*(y+z);
      #while (Cntv.x < nnv.x)
        #local ThingArray[Cntv.x][Cntv.y][Cntv.z] =
          intersection {
            object { Thing }
            box { Point1 + dPoint*Cntv, Point1 + dPoint*(Cntv+Unitv) }
          }
        #local Cntv = Cntv+x;
      #end // while
      #local Cntv = Cntv+y;
    #end // while
    #local Cntv = Cntv+z;
  #end // while

  ThingArray

#end // macro ObjectSplit


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 16:39:42
Message: <38C818FD.2181BD12@hotmail.com>
Hi again

Tor Olav Kristensen wrote:

> Hi
>
> But what if the loop control variable is a vector that is shared
> between several nested loops? (See my example macro below.)

...

>  #local Cntv = Nullv;
> ...

I forgot something: Nullv = <0, 0, 0>
So the above statement resets all 3 components of the counter vector.

I think that it sometimes is nice with a vectors as a counter variables,
because it makes it possible to write compact code where a needed
vector changes as a result of loop counts.

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Richard Speir
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 16:47:20
Message: <38C81CD8.2D67BA71@mindspring.com>
Yeah, I like this idea a lot.  You wouldn't have to re-learn anything if you don't
want to, yet it would have the power of a full featured object oriented language.
I particularly like the ideas posted above of adding the C-style FOR loops and
such.  I would find these particularly helpful as I am just getting my feet wet
with C programming and I could work on my C coding with POV.  Anyway, just my two
cents.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:04:55
Message: <38C81EE7.5E35B960@hotmail.com>
Ron Parker wrote:

> On Thu, 09 Mar 2000 11:10:38 -0800, Ken wrote:
>
> >So the way I see it by adding this you would save yourself the effort
> >of typing one character.
>
> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;

How about making the editor do the re-typing for the lazy ones?

When you type

#declare something +=

and a function key, then the editor just auto-replaces the

+=

with

= something +

so the sentence becomes

#declare something = something +


Regards

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:07:32
Message: <38c820a4$1@news.povray.org>
On Thu, 09 Mar 2000 23:00:07 +0100, Tor Olav Kristensen wrote:
>
>Ron Parker wrote:

>> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;
>
>How about making the editor do the re-typing for the lazy ones?

Because that's just ugly (we don't ALL use the editor built-in to POV for 
Windows, you know) and in any case it just puts off the problems inherent 
in the line above until you come back to maintain it later.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:19:46
Message: <38C82261.6B18E224@hotmail.com>
If you use an editor with copy and paste features,
I would guess that the maximum number of extra
keystrokes you would have to do is about 7 or 8.
(Or even fewer if you use a mouse.)

So the problem isn't that big.

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Ron Parker wrote:

> On Thu, 09 Mar 2000 23:00:07 +0100, Tor Olav Kristensen wrote:
> >
> >Ron Parker wrote:
>
> >> #declare MyArray[25*X+5*Y+Z][Colour.r] = MyArray[25*X+5*Y+Z][Colour.r] + 1;
> >
> >How about making the editor do the re-typing for the lazy ones?
>
> Because that's just ugly (we don't ALL use the editor built-in to POV for
> Windows, you know) and in any case it just puts off the problems inherent
> in the line above until you come back to maintain it later.
>
> --
> These are my opinions.  I do NOT speak for the POV-Team.
> The superpatch: http://www2.fwi.com/~parkerr/superpatch/
> My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Sebastian Strand
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:19:53
Message: <38c82389@news.povray.org>
> new POV-script I am thinking of is fully backwards compatible i.e. you
should
> still be able to just describe a scene in no particular order, just as you
> always have. Some OO-features will hopefully be possible, but you will not
> have to write #declare MySphere1 = new sphere(<0,0,0>, new size(0.5), new
> texture(new pigment(color new vector(<1,1,1>)))));  [...] you should be
able to
> access the attributes of the objects in the scene, for example: #declare
> camera.location = MySphere1.location - <0,0,5>;

These are exactly the kind of modifications/additions I would like to see
too. Not being able to access the location / other properties of an object
without saving it to a variable is a major inconvenience. Each object could
have a name property, so when declaring you would do something like
sphere {
    <0, 0, 0>, 1
     name "Sphere 1"
}

and the sphere could then be accessed like
Sphere1.texture = texture { texWood }
Sphere1.translate(<0, 0, 10>)

A thing that would be very useful would be to be able to add your own
methods and properties to an object, like:
Sphere1.AddMethod("Spin", "vecRot")
Sphere1.Spin = function {
    #local vecPos = Me.position
    Me.translate(-vecPos)
    Me.rotate(vecRot)
    Me.translate(vecPos)
}

Sphere1.Spin(<0, 90, 0>)

This would not interfere with 'normal' pov scripting, but would really make
pov very versatile for advanced users. I do program as a hobby though, so I
don't know what non-programmers might think.

Just my two Finnish "penni"...


¤¤¤¤
¤ Sebastian Strand
¤ E-mail: the### [at] bigfootcom
¤ URL: http://www.zeb.f2s.com/
¤¤¤¤


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:43:22
Message: <chrishuff_99-6AAACE.17450909032000@news.povray.org>
In article <38C82261.6B18E224@hotmail.com>, Tor Olav Kristensen 
<tor### [at] hotmailcom> wrote:

> If you use an editor with copy and paste features,
> I would guess that the maximum number of extra
> keystrokes you would have to do is about 7 or 8.
> (Or even fewer if you use a mouse.)
> 
> So the problem isn't that big.

Umm, maybe you haven't noticed, but POV is available for many different 
platforms. Many people don't use the built in editor, and some versions 
don't have one. Relying on copy and paste or other editor features is a 
poor solution, and only fixes half of the problem(the time it takes to 
type things in).

Which looks more readable? This:
#declare MyArray[25*X+5*Y+Z][Colour.red] = 
MyArray[25*X+5*Y+Z][Colour.red] + 1;
or this:
#declare MyArray[25*X+5*Y+Z][Colour.red] += 1;
? If you are going back to code that was written by someone else or 
which you haven't used in a while, or even which you wrote yesterday, 
this type of thing can save a lot of time debugging.

BTW, another potentially useful operator is ^ for "to the power of". I 
have written a patch which allows this, it seems to work 
perfectly(although it hasn't been heavily tested). Maybe it will be 
included in MegaPOV sometime...

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Curtis
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:50:50
Message: <38c82aca@news.povray.org>
For me the greatest addition would be a switch/case statement, like this:

#switch (some_variable)
    #case int, float, vector, ...
    #end
#end
--
Dave.
mic### [at] sympaticoca
Nieminen Juha <war### [at] sarakerttunencstutfi> wrote in message
news:38c7c815@news.povray.org...
> PoD <pod### [at] globalfreewaycomau> wrote:
> :   for( I=1; I <= 5; I=I+1){...}
>
>   I think that a more povray-type syntax would be:
>
> #for(I=1; I<=5; I++)
>   ...
> #end
>
>   Of course this can be done with a #while-loop, but this kind of shortcut
> just makes life easier.
>   I would also like to see this:
>
> #do
>   ...
> #until(whatever)
>
>   I have at least once needed this kind of feature. With the regular
#while
> loop I had to write the body of the loop twice.
>
>   And this I have suggested before:
>
> #declare A += B;
> #declare A -= B;
> #declare A *= B;
> #declare A /= B;
> etc...
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rune
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 17:52:28
Message: <38c82b2c@news.povray.org>
"Josh English" wrote:
> This is what I'm looking for. I'm no programmer either, but if you ever
publish
> anyhting on it please post it here or let me know (yeah, that's asking a
lot, I
> realize) but this is exactly the kind of thing I would want POV-Ray to be
able to
> do.

Me too! :-)

Greetings,

Rune

---
Updated January 24: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:19:04
Message: <chrishuff_99-90BDDE.18205009032000@news.povray.org>
In article <38c82aca@news.povray.org>, "David Curtis" 
<spa### [at] junkmailcom> wrote:

> For me the greatest addition would be a switch/case statement, like this:
> 
> #switch (some_variable)
>     #case int, float, vector, ...
>     #end
> #end

You mean like this? :-)
Straight from the manual:

"4.2.6.3  The #switch, #case, #range and #break Directives

A more powerful conditional is the #switch  directive. The syntax is as 
follows...

SWITCH_DIRECTIVE:
#switch (   Switch_Value  )   SWITCH_CLAUSE...  [#else   TOKENS...] #end

SWITCH_CLAUSE:
#case(   Case_Value  )  TOKENS...  [#break ] |
#range(   Low_Value  ,  High_Value  )  TOKENS...  [#break ]"

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Curtis
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:44:42
Message: <38c8376a@news.povray.org>
Chris Huff <chr### [at] yahoocom> wrote in message
news:chrishuff_99-90BDDE.18205009032000@news.povray.org...
>
> You mean like this? :-)
> Straight from the manual:
>
> "4.2.6.3  The #switch, #case, #range and #break Directives
>
> A more powerful conditional is the #switch  directive. The syntax is as
> follows...
>

Doh! You know, I've sat down numerous times with the intention of reading
througth the manual. But as is always the case I find something I "just
gotta try".

Thanks.

--
Dave.
mic### [at] sympaticoca


Post a reply to this message

From: Bob Hughes
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:51:31
Message: <38c83903@news.povray.org>
Yep, I almost mentioned that but I'm clinging to the anti-programming side so
wanted to try not making it seem as plausible.  I'm bad, I know... sorry  ;-)

Bob

"Sebastian Strand" <the### [at] bigfootcom> wrote in message
news:38c7dcbf$1@news.povray.org...
|
| > |   for I = 1 to 5 {...}
| >
| > This one isn't feasible since the increment isn't changeable, as written
| anyhow.
|
| In Visual Basic this is done like so:
|
| For i = 1 To 5 Step 3
| ...
| Next i
|
| ¤¤¤¤
| ¤ Sebastian Strand
| ¤ E-mail: the### [at] bigfootcom
| ¤ URL: http://www.zeb.f2s.com/
| ¤¤¤¤
|
|
|
|
|


Post a reply to this message

From: Bill DeWitt
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 18:56:02
Message: <38c83a12@news.povray.org>
"Ken" <tyl### [at] pacbellnet> wrote :
>
> Would you have difficulty re-learning POV-Ray if it's language format
> changed ?

    That, of course, depends on what it is changed to...

>
> Would you resent it or maybe even quit using the program completely ?
>

    I wouldn't resent it, but if it was just a little hard to re-learn, I
have a couple of commercial programs laying around that I just need a good
excuse to learn.


Post a reply to this message

From: Bob Hughes
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 19:02:27
Message: <38c83b93@news.povray.org>
"Chris Huff" <chr### [at] yahoocom> wrote in message
news:chrishuff_99-6AAACE.17450909032000@news.povray.org...
|
| Umm, maybe you haven't noticed, but POV is available for many different
| platforms. Many people don't use the built in editor, and some versions
| don't have one.

Please excuse my momentary lapse into exuberance while I say: heck with that,
how about auto-completion of keywords in the CodeMax editor!  Wouldn't that be a
nifty item to add?
That said, I'm settling back down now.

Bob


Post a reply to this message

From: David Fontaine
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 19:09:50
Message: <38C83C8E.DBC90269@faricy.net>
I agree with most of the people; keep the current stuff the way it is, but add
some more programming features.
#for (I=1,I<5,I=I+1) #end
instead of
#declare I=1; #while(I<5) #declare I=I+1; #end
some people showed examples like #for {}, but I think it would be better to
keep the #end statement as it is how it's been done so far, but also, because
the syntax and syntax coloring is very helpful in sorting out parser code from
object code.

--
___     _______________________________________________
 | \     |_          <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine        http://www.faricy.net/~davidf/

"The only difference between me and a madman is that I'm not mad." -Dali


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 19:11:34
Message: <chrishuff_99-20910D.19132109032000@news.povray.org>
In article <38c83b93@news.povray.org>, "Bob Hughes" 
<per### [at] aolcom?subject=PoV-News:> wrote:

> Please excuse my momentary lapse into exuberance while I say: heck 
> with that, how about auto-completion of keywords in the CodeMax 
> editor!  Wouldn't that be a nifty item to add?

That would be a nice option for the Mac version too, which I believe 
uses the WASTE text engine. This capability might be built in to the 
WASTE engine already...

Still, my first point was a platform specific editor feature is no 
substitute for a language feature.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Fontaine
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 19:14:38
Message: <38C83DAA.69983E66@faricy.net>
Tor Olav Kristensen wrote:

> How about making the editor do the re-typing for the lazy ones?

1) What if you want to change it later? You have to do it twice.
2) People can use whichever syntax they prefer.
3) If more and more fancy features are added to the editor it will consume more
resources.
   a) I'm not saying I don't like column-select and all that; very useful!
   b) I don't like it when the computer modifies my work.
4) :-p

--
___     _______________________________________________
 | \     |_          <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine        http://www.faricy.net/~davidf/

"The only difference between me and a madman is that I'm not mad." -Dali


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 9 Mar 2000 19:53:59
Message: <slrn8cgidf.1op.ron.parker@linux.parkerr.fwi.com>
On Thu, 09 Mar 2000 23:14:57 +0100, Tor Olav Kristensen wrote:
>If you use an editor with copy and paste features,
>I would guess that the maximum number of extra
>keystrokes you would have to do is about 7 or 8.
>(Or even fewer if you use a mouse.)

There are other reasons to prefer += in a case like that.  If I have 

#declare [big complicated expression] += 3;

and 

#declare [big complicated expression] = [big complicated expression]+3;

and I'm trying to debug the code, I don't have to verify that the 
big complicated expression in the first statement matches anything.

Also, it helps parse time if POV only has to parse the big complicated 
expression once.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 00:08:27
Message: <38c8834b@news.povray.org>
In article <chrishuff_99-20910D.19132109032000@news.povray.org> , Chris Huff
<chr### [at] yahoocom>  wrote:

> That would be a nice option for the Mac version too, which I believe
> uses the WASTE text engine. This capability might be built in to the
> WASTE engine already...

No, unfortunately not. The WASTE text engine is actually targeted as a
replacement for small scale word processing (World Script Aware _Styled_
Text Engine), and was originally not even designed as plain editor.
In the official version I had to add numerous hooks support all the nice
editor-like features like auto-indenting and syntax coloring. MacMegaPOV
also uses WASTE, and currently has functions around WASTE to get indenting.

Either way, WASTE was not designed as an editor. It does a good job, but
adding such features as auto-completion is either done by a lot of working
around it or by some inside modifications and hooks.  It is possible with
reasonable work, but not a free feature :-(


    Thorsten


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 04:46:50
Message: <38c8c48a@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: So the way I see it by adding this you would save yourself the effort
: of typing one character.

#declare LoopXIndex = LoopXIndex + 1;

#declare LoopXIndex += 1;

: The question the potential patch writer must
: ask himself then is if it be worth the effort to patch the program to
: accept this new style of arguement just to save the user from having
: to type one more character into their scene file.

  I don't think that it would be hard to implement.
  In the same way one could ask why we need a torus primitive when we can
do it with a quartic?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 04:51:16
Message: <38c8c594@news.povray.org>
Tor Olav Kristensen <tor### [at] hotmailcom> wrote:
: But what if ...

  The idea was not to _replace_ the while-loop, but make an _addition_ to
the povray language. You don't have to use it if you don't want to.


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 04:54:37
Message: <38c8c65d@news.povray.org>
I think that there should some struct-type and reference-type data types.
This would allow, for example, making linked lists.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Axel Baune
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 06:20:30
Message: <38C8DAB2.3BE14CC3@neuro.informatik.uni-ulm.de>
Hello,

PoD wrote:
> 
> Axel Baune wrote:
> >
> >[Snip]
> >Another problem will be the
> > 'dirty' programming for people without programming-knowledge. The
> > example given by PoD is one of them:
> 
> dirty programming?

Sorry, I didn't wanted to say that the given example incorporates dirty
programming. What I've meant to say was, that from the given example
could dirty programming easily derived (see my desciption of problems
and the following)   

> > No I think not that this would make life easier for all. Problem one:
> > what will be the value of the variables outside the for-loop?
> 
> The same as it would be using a while loop?

No, I don't think so. In most programming languages the state of the
variables used in a for-loop are undefined outside the loop, but most
programmers ignores this and use the mostly undocomented feature, that
after the for-loop the variable has the value of the variable in the
last loop incremented by the specified step. Whereas after a while loop
the variable has the value obtained by the last user operation on the
variable. The problem derives, because in a for loop the variable
belongs sytactically to the for command. From the viewpoint of a
computer scientist  (I'm one) the variable in a for-loop should _never_
be changeable by a user and should have only one variable, but most
compiler of programming languages ignores this, beause it is to
complicated to prove this. Threrfore while-constructs show a more well
defined behaviour and should always be used.

> >Problem
> > two: What if you want to increment the variable in non deterministic
> > steps, e.g. different steps width in each loop or you didn't want to
> > increment in each loop. Than you will need the old while-construct, and
> > why blowing up Pov-Script with higly specialised commands if you already
> > have flexibler and more general commends for them? As a more skilled
> > programmer you can always write macros for specialised problems. 

> Then use a while loop and nothing is lost, except that you've made your
> script hard to read.  There's probably an easier way to do it using
> for()

No, you couldn't do everything with a for-loop what you could do with a
while-loop. The while-loop is far more flexible, beacuse the for-loop is
a special case of the while-loop for cases where _one_ variable is
looped through a range of values with a constant step width. 

> >Problem
> > three: What if somebody changes the variable explicitly inside the
> > loop-body. I think these problems complicates the life of PoV-people
> > without programming-knowledge, especially if some of these persons want
> > to understand code from other people with more skilled
> > programming-knowledge (especially if those people used 'dirty' and
> > mostly undocumented programming constructs).
> 
> See answer to 2

See answer to 1

Yours Axel Baune


Post a reply to this message

From: Axel Baune
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 06:27:13
Message: <38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de>
Hello,

Johannes Hubert wrote:
> 
> "PoD" <pod### [at] merlinnetau> wrote in message
> news:38C7EEA3.D0EE7FF1@merlin.net.au...
> > Axel Baune wrote:
> 
> > >Problem
> > > two: What if you want to increment the variable in non deterministic
> > > steps, e.g. different steps width in each loop or you didn't want to
> > > increment in each loop. Than you will need the old while-construct,
> and
> > > why blowing up Pov-Script with higly specialised commands if you
> already
> > > have flexibler and more general commends for them? As a more skilled
> > > programmer you can always write macros for specialised problems.
> >
> > Then use a while loop and nothing is lost, except that you've made
> your
> > script hard to read.  There's probably an easier way to do it using
> > for()
> 
> For example:
> 
> for (I = 1; I <= something; ) {
>     // loop body here
>     I += non_deterministic_increment;
> }
> 
> Johannes

This a an example of dirty programming!

From the viewpoint of a computer scientist (I'm one) this is a not a
syntactically correct defiend for-loop. The variable of a for-loop
belongs to the for-command and should be never _changable_ by the user. 

Sorry for flaming, but this are the programming styles, which make
software packages difficult to maintain, debug, readable and
understandable by other programmers.

Yours Axel Baune


Post a reply to this message

From: Axel Baune
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 06:32:11
Message: <38C8DD71.3560294C@neuro.informatik.uni-ulm.de>
Ken wrote:
> 
> Johannes Hubert wrote:
> >
Hello,

> > "ingo" <ing### [at] homenl> wrote in message
> > news:8EF2B8E07seed7@204.213.191.228...
> > > Nieminen Juha wrote:
> > >
> > > >#declare A += B;
> > > >#declare A -= B;
> > >
> > > What does it mean?
> >
> > the same as
> >
> > #declare A = A + B;
> > #declare A = A - B;
> 
> So the way I see it by adding this you would save yourself the effort
> of typing one character. The question the potential patch writer must
> ask himself then is if it be worth the effort to patch the program to
> accept this new style of arguement just to save the user from having
> to type one more character into their scene file. Reduced to this it
> would seem a petty feature.
> 
> --
> Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/

I agree.

The variant

> > #declare A = A + B;
> > #declare A = A - B;

is far more readable than the other. Besides this it would comlicate the
parser of PoV if the other variant should be maintained. This will lead
to a new type of possible parser bugs.  

Yours Axel Baune


Post a reply to this message

From: Axel Baune
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 06:39:59
Message: <38C8DF45.B0FF5DD8@neuro.informatik.uni-ulm.de>
Hello,

For a good programming style you should declare your 'big complicated
expression' beforehand, like:

#declare big_complicated_expression = <some complicated expressions>;
#declare [big_complicated_expression] = [big_complicated_expression]+3;

because an array desciptors with complicated expressions are very
unreadable.

Yuors Axel Baune


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 07:05:16
Message: <chrishuff_99-3FC67E.07070310032000@news.povray.org>
In article <38c8834b@news.povray.org>, "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> Either way, WASTE was not designed as an editor. It does a good job, 
> but adding such features as auto-completion is either done by a lot 
> of working around it or by some inside modifications and hooks.  It 
> is possible with reasonable work, but not a free feature :-(

Ah, thanks for clarifying that.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 07:20:45
Message: <chrishuff_99-CC07EC.07223210032000@news.povray.org>
In article <38C816BE.35E35A1C@hotmail.com>, Tor Olav Kristensen 
<tor### [at] hotmailcom> wrote:

> But what if the loop control variable is a vector that is shared
> between several nested loops? (See my example macro below.)
> 
> Would this be possible with nested for-loops?

It would be possible, but not necessarily the best way to do it. 
Something like this:


#macro ObjectSplit(Thing, Point1, Point2, nnv)
// Cuts an object into several "box"-parts
// Result is returned in an array of such parts

  //#local nnv = <nx, ny, nz>;
  #local ThingArray = array[nnv.x][nnv.y][nnv.z]
  #local dPoint = (Point2 - Point1)/nnv;

  #for(Cntv = <0,0,0>; Cntv.z < nnv.z; Cntv.z += 1)
    #for(Cntv.y = 0; Cntv.y < nnv.y; Cntv.y += 1)
      #for(Cntv.x = 0; Cntv.x < nnv.x; Cntv.x += 1)
        #local ThingArray[Cntv.x][Cntv.y][Cntv.z] =
          intersection {
            object { Thing }
            box { Point1 + dPoint*Cntv, Point1 + dPoint*(Cntv+Unitv) }
          }
      #end // for
    #end // for
  #end // for

  ThingArray

#end // macro ObjectSplit

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 07:58:40
Message: <38c8f180@news.povray.org>
Axel Baune <aba### [at] neuroinformatikuni-ulmde> wrote:
: The variant

:> > #declare A = A + B;
:> > #declare A = A - B;

: is far more readable than the other.

  In this case yes. But what about a longer identifier, like something
already suggested:

#declare ColorArray[ColorIndex][ColorSubIndex].red =
  ColorArray[ColorIndex][ColorSubIndex].red + 1;

or:

#declare ColorArray[ColorIndex][ColorSubIndex].red += 1;

  Note also that if one of the indices is a complex mathematical operation,
it would have to be calculated twice, instead of just once.
  Also if you have to modify the line, you would have to do it in two places
in the line instead of just one place.
  And you don't have to use the feature if you don't want to. The existance
of a feature doesn't make it mandatory to use it. I don't make a quartic
to get a torus although this possibility exists and is an inherent feature
in povray.

: Besides this it would comlicate the
: parser of PoV if the other variant should be maintained.

  Was this only a guess or do you really know that it will be conclusively
more complicated?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 08:34:13
Message: <38c8f9d5$1@news.povray.org>
On 10 Mar 2000 07:58:40 -0500, Nieminen Juha wrote:
>Axel Baune <aba### [at] neuroinformatikuni-ulmde> wrote:
>: Besides this it would comlicate the
>: parser of PoV if the other variant should be maintained.
>
>  Was this only a guess or do you really know that it will be conclusively
>more complicated?

It had to have been a guess.  It wouldn't be that complicated to do.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Axel Baune
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 10:16:15
Message: <38C911F2.EA6F9E@neuro.informatik.uni-ulm.de>
Hello,

Ron Parker wrote:
> 
> On 10 Mar 2000 07:58:40 -0500, Nieminen Juha wrote:
> >Axel Baune <aba### [at] neuroinformatikuni-ulmde> wrote:
> >: Besides this it would comlicate the
> >: parser of PoV if the other variant should be maintained.
> >
> >  Was this only a guess or do you really know that it will be conclusively
> >more complicated?
> 
> It had to have been a guess.  It wouldn't be that complicated to do.

As I've never looked into the Code for the PoV-Parser I' did"t know
exactly, but I've already written a parser of my own for my programms,
and therefore I know what effects it would have on my own parser if I
wish to include the new syntax. From this knowledge I've extrapolated to
the PoV-Parser.

Yours Axel Baune


Post a reply to this message

From: Gilles Tran
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 10:20:15
Message: <38C912E2.15063774@inapg.inra.fr>
Ken wrote:

> Would you have difficulty re-learning POV-Ray if it's language format
> changed ?
> Would you resent it or maybe even quit using the program completely ?

I believe that the first purpose of POV is to allow a large number
of people from very different educational backgrounds to make excellent
pictures for free. I'm also aware that an important part of the POV
community does not see POV as a mean to obtain pictures (i.e.
they don't see the resulting picture as a primary goal), but as a mean to
derive pleasure from the intellectual game of programming the pictures. In
fact, a good number of people enjoy programming POV itself rather
than doing images  : think for instance that some patches were
never documented until recently, as if the sole purpose of
the patch was its programming and not having other people using it.
Of course, the fact that some people are primarily interested in
programming POV is very fortunate otherwise there would be
no POV at all !

However, I'd like to point out that whatever faults programmers
can find in the current scene description language, it is also
because it is "faulty" that non-programmers can learn it,
enjoy it, and make pov popular. So there's a potential conflict
here, since programmers may differ from non programmers about
what a "good" feature is, and what "faulty" means.

One interesting comparison can be made with BMRT : BMRT is free,
it uses an industry standard (RIB), it is (supposedly) immensely
powerful and its output,as far as I know, is very good.
But you won't find many BMRT pictures around (just look at the
IRTC) and the ones I've seen so far are of the "impressive feature
demonstration" kind. I guess that's because BRMT's
quality is obtained at the expense of it being programmer-oriented.

Now everyone can download POV, and run immediately a demo
scene which is written in something understandable for the non-programmer
type (in the Windows version this is automatic).
In a couple of seconds, you can change something in the code
without looking at the manuel and lo, here's your first scene.
It's not 100% intuitive, but it's not difficult either.
That's how I got started, and I supposed lots of people got
hooked like that. I'd like to keep this "philosophy" alive with POV,
because this is what makes it unique.

Of course I don't want to be conservative : POV can (should) evolve.
But my personal wish list is made of features that would make the
user's life easier in terms of creation (like a really
fast Cloud layer object, ā la Terragen, for instance, or the direct
support of some popular mesh formats, or a simple way to make
patina and cracks, or built-in "fur" and "tree" engines etc.).
I have to recognize that some programming features (like arrays
or macros) that seemed complex at the beginning (yes, for a
non-programmer, even arrays are complex !) proved themselves
very useful. My current concern, which I seem to share with
Ken Tyler, is that many of features I've seen on programmers'
"wish lists" looked like they would surely improve the lives
of programmers and possibly make pov faster, or more flexible,
but that they would also make a few non-programmers cringe.
For instance, some people may have fun browsing a 500-page
long manual on OO programming, some others don't.

Would there be better pictures ? In many cases, theoretically yes.
But the people who advocate these changes should think about
the potential risk of reducing POV's user basis, since
the probability of having talented users using the new
advanced features, or using POV at all, would also be reduced,
what I'd call the "BMRT syndroma". In some cases, I'm under
the impression that the proposed changes are for the
sake of "proper" programming only, or for POV becoming closer
to the C language, with no real concern about the way
non-programmers actually use POV. I'm not sure that
maintaining several forms of the language (the regular and the new
one) would be very practical, both for users and POV developpers
(is backward compatibility really fun to maintain ?). Having
several ways to express the same idea/object/whatever would
make things very confusing for many users (and a larger manual
harder to read and maintain).

To answer Ken's questions, I surely would experience trouble if
the language changed completely. I've got my own legacy of scenes
(which already hard to maintain due to version changes and
immoderate patch use), and I'm able to work fast because I
know my way in POV (provided the help file is open !).
So having a new language format would be like using a
new software : I would take the trouble to learn it only if
it was clearly "competitive", in terms of user-friendliness
and features, over the current POV implementation.

Gilles Tran


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 10:49:21
Message: <38c9197f@news.povray.org>
Axel Baune <aba### [at] neuroinformatikuni-ulmde> wrote:
: As I've never looked into the Code for the PoV-Parser I' did"t know
: exactly, but I've already written a parser of my own for my programms,
: and therefore I know what effects it would have on my own parser if I
: wish to include the new syntax. From this knowledge I've extrapolated to
: the PoV-Parser.

  Perhaps you didn't do it the right way ;)

  Using something like yacc and lex makes it quite easy to add new syntax.
Although povray doesn't use them, it might use something similar (I really
don't know).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 10:50:46
Message: <38c919d5@news.povray.org>
Gilles Tran <tra### [at] inapginrafr> wrote:
: I'm also aware that an important part of the POV
: community does not see POV as a mean to obtain pictures (i.e.
: they don't see the resulting picture as a primary goal), but as a mean to
: derive pleasure from the intellectual game of programming the pictures.

  Music to my ears... :)


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: PoD
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 13:08:42
Message: <38C94030.FA03A614@merlin.net.au>
If you use the C style of for() loop, you can do more than just fixed
step incrementing/decrementing, though if I understand you correctly you
don't seem to like that.
I've seen some pretty ugly for() loops in C.
This is getting away from the gist of the thread though.  Adding more
control statements to POV would not make the language more difficult for
non-programmers, it would just make it more powerful for those who wish
to use those features for scene construction.

BTW is there any real reason for all those #s?
Would anything break if they were made optional?

PoD.


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 16:32:51
Message: <chrishuff_99-2057BF.16343910032000@news.povray.org>
In article <38C8DD71.3560294C@neuro.informatik.uni-ulm.de>, Axel Baune 
<aba### [at] neuroinformatikuni-ulmde> wrote:

> The variant
> 
> > > #declare A = A + B;
> > > #declare A = A - B;
> 
> is far more readable than the other.

I disagree. I find this syntax:
#declare NumOfParts += PartsAdded;
#declare NumOfParts -= PartsRemoved;

much easier to read than:
#declare NumOfParts = NumOfParts + PartsAdded;
#declare NumOfParts = NumOfParts - PartsRemoved;


I read the += operator as saying "add B to A", instead of "set variable 
A to the result of adding A and B". It is a special case, and while more 
limited, makes code more readable since you know exactly what the code 
is intended to do.
Also, shorter expressions are almost always more readable than longer 
ones, even if the longer one is theoretically "cleaner".(within certain 
limits, of course. Warp's sig is not an example of shorter==better.) And 
the duplicated portion can often get quite large, even when it can't be 
put in a separate variable(I very rarely use single character names, I 
usually only use them for loop counters.).


> Besides this it would comlicate the parser of PoV if the other 
> variant should be maintained. This will lead to a new type of 
> possible parser bugs.  

As has already been said by others, this isn't true.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 16:52:45
Message: <chrishuff_99-A03AEE.16543310032000@news.povray.org>
In article <38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de>, Axel Baune 
<aba### [at] neuroinformatikuni-ulmde> wrote:

> From the viewpoint of a computer scientist (I'm one) this is a not a
> syntactically correct defiend for-loop. The variable of a for-loop
> belongs to the for-command and should be never _changable_ by the user. 

Why? I see it as just another specialized structural component, which 
should be used when it is appropriate. Your restriction on modifying the 
loop variable seems arbitrary...
You say you are a computer scientist, but are you a computer programmer? 
I am still inexperienced with programming(I've only done a couple 
particle simulators and a few POV patches), but I can't think of any 
reason the loop variable shouldn't be used except for counting.

Maybe if you defined a for loop as a block of code that is executed a 
fixed number of times...but then, why have an initializer and an 
increment statement? Your for loop should only take one parameter(the 
number of times to loop) and should always increment by 1. You could use 
this to do everything an ordinary for loop with your restriction could 
do...
It is just that your definition seems to be going to an extreme(the 
other extreme being only using goto. :-) ).


> Sorry for flaming, but this are the programming styles, which make
> software packages difficult to maintain, debug, readable and
> understandable by other programmers.

How is it hard to understand?

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 16:59:15
Message: <chrishuff_99-FAC613.17010310032000@news.povray.org>
In article <38c8c65d@news.povray.org>, Nieminen Juha 
<war### [at] sarakerttunencstutfi> wrote:

>   I think that there should some struct-type and reference-type data 
>   types.
> This would allow, for example, making linked lists.

I think union could be used for this if the ability to bind variables 
and macros to objects was added. I would also like to see a pointer-like 
feature added(with checking for valid accesses, of course). I think this 
is what you meant by "reference-type data types". Probably something to 
think about for POV 4.0...(or 4.1) :-)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Matt Giwer
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 19:26:35
Message: <38C992EA.4C6238BD@ij.net>
PoD wrote:
> 
> Some aspects of the language which relate purely to programming could be
> changed or (probably better) extended without affecting those who don't
> use them.
> 
> For a non-programmer or a programmer , macros, loops etc are a lot
> harder in POV than the equivalents in most programming languages.
> 
> Surely replacing
>   #declare I=1; #while(I<=5) ... #declare I=I+1;#end
> with either
>   for I = 1 to 5 {...}
> ala Basic, or even for a non-programmer,
>   for( I=1; I <= 5; I=I+1){...}
> would make life easier for all.

	So what is the difference other than a different syntax? The 123
ways to create a loop? They all do the same thing in the end.
Even step = 3 with I=I+3. 

	Introducing additional syntaxes raises more problems than it
solves. With one elementary syntax that can do everything there
isn't nearly as much to read and a hundred fewer places for
parser differences to creep in. 

	Next, complex conditional if then else statements. Can GOTO be
far behind?


Post a reply to this message

From: Matt Giwer
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 19:34:40
Message: <38C994D0.C4A06309@ij.net>
Johannes Hubert wrote:
> 
> "ingo" <ing### [at] homenl> wrote in message
> news:8EF2B8E07seed7@204.213.191.228...
> > Nieminen Juha wrote:
> >
> > >#declare A += B;
> > >#declare A -= B;
> >
> > What does it mean?
> 
> the same as
> 
> #declare A = A + B;
> #declare A = A - B;

	OK. Any what is the value beyond saving a few keystrokes? 

	The time required for extra keystrokes is the last thing that
worries even the best of programmers.


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 20:03:22
Message: <chrishuff_99-BC2AD4.20051010032000@news.povray.org>
In article <38C992EA.4C6238BD@ij.net>, Matt Giwer <jul### [at] ijnet> 
wrote:

> 	So what is the difference other than a different syntax? The 123
> ways to create a loop? They all do the same thing in the end.
> Even step = 3 with I=I+3. 
> 
> 	Introducing additional syntaxes raises more problems than it
> solves. With one elementary syntax that can do everything there
> isn't nearly as much to read and a hundred fewer places for
> parser differences to creep in. 

The only difference is syntax. But that is a meaningful difference. 
Although a for loop could also be implemented as a while loop, it can 
sometimes be easier to write and understand if written as a for loop.

And what do you mean by "a hundred fewer places for parser differences 
to creep in"? I don't think the modifications would be very extensive, 
and there is only one parser.


> 	Next, complex conditional if then else statements. Can GOTO be
> far behind?

Umm, we have if-then-else statements. And switch statements. And goto is 
a bad idea for many reasons.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: The Language of POV-Ray
Date: 10 Mar 2000 20:07:36
Message: <chrishuff_99-F39B67.20092410032000@news.povray.org>
In article <38C994D0.C4A06309@ij.net>, Matt Giwer <jul### [at] ijnet> 
wrote:

> > #declare A = A + B;
> > #declare A = A - B;
> 
> 	OK. Any what is the value beyond saving a few keystrokes? 
> 
> 	The time required for extra keystrokes is the last thing that
> worries even the best of programmers.

Better readability, code which is easier to maintain without introducing 
new bugs, etc. The examples given make using = and + look good, but they 
also use single-character variable names. Just about the only time I use 
single-character variable names is in loop counters, most of the time 
the names are longer. Add in using multidimensional arrays, and you 
quickly get to line lengths that are very difficult to keep track of and 
modify later.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

<<< Previous 17 Messages Goto Latest 50 Messages Next 50 Messages >>>

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