POV-Ray : Newsgroups : povray.general : feature request (regarding &,|) Server Time
8 Aug 2024 20:27:47 EDT (-0400)
  feature request (regarding &,|) (Message 11 to 20 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Margus Ramst
Subject: Re: feature request (regarding &,|)
Date: 17 Nov 2000 19:06:27
Message: <3A15C83B.B487233F@peak.edu.ee>
Jamie Davison wrote:
> 
> Because not everybody on these groups, or indeed everybody who uses POV,
> is experienced in, or capable of reading C style code.
> 
> I have enough trouble reading POV code as it is, and adding (more)
> abstract symbols to the scene description language would kill my ability
> to understand roughly what is happening in a scene file.
> 

The proposed change would add nothing to the scene language; it would change the
way an existing operator is parsed.
Frankly, the way it works now initially caused more confusion for me, since I
did not see the point in evaluating the second part of the conditional, if the
whole condidtional was already bound to return "false".

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Margus Ramst
Subject: Re: feature request (regarding &,|)
Date: 17 Nov 2000 19:15:31
Message: <3A15CA5E.DC4C415C@peak.edu.ee>
Chris Huff wrote:
> 
> If that extremely_long_calculation sets up some variables for later use,
> not evaluating it could lead to obscure bugs in scene files.

Hmm. Are there many likely scenarios of this happening?
Granted, a macro invoked in a conditional could #declare variables needed later
in the code; but creating necessary variables like this is very bad form IMO, as
is (generally) using #declare in a macro to set up global variables.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Chris Huff
Subject: Re: feature request (regarding &,|)
Date: 18 Nov 2000 13:17:45
Message: <chrishuff-ED3435.13180318112000@news.povray.org>
In article <3A15CA5E.DC4C415C@peak.edu.ee>, Margus Ramst 
<mar### [at] peakeduee> wrote:

> Hmm. Are there many likely scenarios of this happening?

Not a lot, but I see no reason to add something that can cause such 
confusion and would only have a slight benefit.


> Granted, a macro invoked in a conditional could #declare variables 
> needed later in the code; but creating necessary variables like this 
> is very bad form IMO, as is (generally) using #declare in a macro to 
> set up global variables.

It might be bad form, but it is possible and is sometimes the easiest 
way to do things. Remember that not all POV users are programmers who 
care about good form...this would just be considered a nuisance by them. 
And I think it is "bad form" for a language to do this type of thing, 
because there is no indication of what is happening when it occurs. It 
can be done manually, and can cause problems when done automatically.

Maybe if there was a warning when a macro call was skipped, or if it 
only skipped things other than macro calls...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 05:22:15
Message: <3a18fb57@news.povray.org>
Jamie Davison <jam### [at] dh70qdu-netcom> wrote:
: Sorry if I'm ranting, but I get a little fed up of seeing people trying 
: to turn POV into a programming language, when, in my opinion, it isn't 
: and shouldn't be.

  But the povray scripting language IS a programming language (since it's
Turing-strong).
  Making it a better programming language can make only good.

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


Post a reply to this message

From: Warp
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 05:25:11
Message: <3a18fc06@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: Not a lot, but I see no reason to add something that can cause such 
: confusion and would only have a slight benefit.

  I see many reasons to add something that has so many benefits although
it might rarely sometimes cause some confusion.

  Things can always be said in two ways :)

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


Post a reply to this message

From: Ken
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 11:20:09
Message: <3A194FC3.ACA50B97@pacbell.net>
Warp wrote:
> 
> Chris Huff <chr### [at] maccom> wrote:
> : Not a lot, but I see no reason to add something that can cause such
> : confusion and would only have a slight benefit.
> 
>   I see many reasons to add something that has so many benefits although
> it might rarely sometimes cause some confusion.
> 
>   Things can always be said in two ways :)

Now I'm confused !

-- 
Ken Tyler - 1400+ POV-Ray, 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: Jamie Davison
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 13:51:00
Message: <MPG.148382314e8553fc989850@news.povray.org>
On 20 Nov 2000 05:22:15 -0500, Warp wrote...
> : Sorry if I'm ranting, but I get a little fed up of seeing people trying 
> : to turn POV into a programming language, when, in my opinion, it isn't 
> : and shouldn't be.
> 
>   But the povray scripting language IS a programming language (since it's
> Turing-strong).
>   Making it a better programming language can make only good.

By better, I assume you mean more like other, established general purpose 
programming languages, e.g. C, C++?

Personally, that doesn'y fit my definition of 'better'  But that's 
probably just me.

Of course it's entirely possible that I'm misinterpreting something 
somewhere along the lines.

Bye for now,
     Jamie.


Post a reply to this message

From: Ron Parker
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 16:10:50
Message: <slrn91j4qs.ccg.ron.parker@fwi.com>
On Fri, 17 Nov 2000 17:56:05 -0600, David Fontaine wrote:
>because you don't need to read ahead or look at indentation to see that you're
>limiting a to an interval (0,10) (or is that [0,10]?). Same goes for a

(0,10)

>non-contigous set:
>  #if((a>0 & a<10) | a>20 | a=15)
>Imagine that coded as individual tests!

I think you might be missing the important point here: we currently have and
and or operators, but they don't short-circuit.  The result is that you
can't say things like

#if ( a != 0 and 5/a > 2 )

because the parser will puke on 5/a if a really is zero.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: feature request (regarding &,|)
Date: 20 Nov 2000 16:21:40
Message: <chrishuff-777F37.16220120112000@news.povray.org>
In article <3a18fc06@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I see many reasons to add something that has so many benefits although
> it might rarely sometimes cause some confusion.

What benefits? A small parsing speedup every once in a while, and more 
rarely a fairly large speed improvement. And this can already be 
accomplished by using a slightly different structure with the current 
language, by nesting the conditionals.

Oh, and it lets you write nicely obfuscated code that doesn't do what it 
appears to do, like this:

#if(ACondition & DoSomething()) #end

which would really be the same as this:

#if(ACondition)
    DoSomething()
#end

So, no real benefits, since what it does can easily be done manually 
already, and it adds possible confusion.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David Fontaine
Subject: Re: feature request (regarding &,|)
Date: 21 Nov 2000 00:45:56
Message: <3A1A0BA7.B7A96E1B@faricy.net>
Ron Parker wrote:

> #if ( a != 0 and 5/a > 2 )
>
> because the parser will puke on 5/a if a really is zero.

Hmm, didn't think of that scenario...

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


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.