POV-Ray : Newsgroups : povray.general : The Language of POV-Ray Server Time
10 Aug 2024 13:19:59 EDT (-0400)
  The Language of POV-Ray (Message 41 to 50 of 297)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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