POV-Ray : Newsgroups : povray.general : POV Parsing Server Time
9 Aug 2024 13:26:00 EDT (-0400)
  POV Parsing (Message 33 to 42 of 52)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Chris Huff
Subject: Re: POV Parsing
Date: 31 Aug 2000 19:36:13
Message: <chrishuff-CAD5D9.18374931082000@news.povray.org>
In article <39aedd8c@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   ?:

Yuck.
I did't think this was supported by POV, but I found a reference in the 
documentation(though it took searching for all ? marks...). Oh, 
well...it might be considered equivalent to the #if-#else-#end group, or 
it might be considered a separate one.

-- 
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: POV Parsing
Date: 31 Aug 2000 22:38:57
Message: <39af16c1@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
:>   ?:

: Yuck.
: I did't think this was supported by POV

  Even a very advanced user doesn't know every single feature of povray :)

-- 
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: David Fontaine
Subject: Re: POV Parsing
Date: 31 Aug 2000 23:27:05
Message: <39AF1FCD.4B0CE825@faricy.net>
Warp wrote:

> Chris Huff <chr### [at] maccom> wrote:
> : miss any?
>
>   ?:

Yup! Now why would they put that in POV but not things like +=, -=, *=, /=,
++, --? And where's the stinkin' #for? :)
Will 3.5 have operators instead of functions for modulo and/or powers?

--
David Fontaine   <dav### [at] faricynet>   ICQ 55354965
Please visit my website:  http://davidf.faricy.net/


Post a reply to this message

From: Chris Huff
Subject: Re: POV Parsing
Date: 1 Sep 2000 00:19:09
Message: <chrishuff-AA06DF.23204431082000@news.povray.org>
In article <39AF1FCD.4B0CE825@faricy.net>, David Fontaine 
<dav### [at] faricynet> wrote:

> Yup! Now why would they put that in POV but not things like +=, -=, 
> *=, /=, ++, --?

Don't ask me...though I will look to see how difficult it would be to 
add them.


> And where's the stinkin' #for? :)

Now, *this* I have no idea how to implement, though I would use a 
C/Java-like syntax instead of the BASIC-like syntax.


> Will 3.5 have operators instead of functions for modulo and/or powers?

Unknown. I have written a patch which adds a ^ operator for 
exponentiation, but it may not be included. The modulo operator would be 
just as easy...but the best operator to use for it would be %, and that 
is already used in MegaPOV as a shortcut for #local. Both of these 
operators are useable in functions, however.

-- 
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: Bob Hughes
Subject: Re: POV Parsing
Date: 1 Sep 2000 02:24:39
Message: <39af4ba7@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-BA3801.11085731082000@news.povray.org...
| Hmm, the POV-Script list would be:
| #while, #if, #else, #switch, #case, #range, #macro, #end, #break...did I
| miss any?
| Oh, #include, I guess...and MegaPOV functions.

Also #ifdef, #ifndef.

That's all the Conditional Directives I think.    #else, #end, #case, #break
aren't actually "conditional" I guess.

In the Doc it lists Language Directives like this:

#break #case #debug #declare
#default #else #end #fclose
#fopen #local #macro #read
#render #statistics #switch #undef
#version #warning #write

#error is mentioned elsewhere and yet not shown in the list.  Maybe a
mistake in the Doc, it's called "Fatal" in the Text Stream section.

Bob


Post a reply to this message

From: David Fontaine
Subject: Re: POV Parsing
Date: 2 Sep 2000 03:52:53
Message: <39B0AF91.5F1864F@faricy.net>
Chris Huff wrote:

> > And where's the stinkin' #for? :)
>
> Now, *this* I have no idea how to implement, though I would use a
> C/Java-like syntax instead of the BASIC-like syntax.

From a preprocessor perspective,
   #for(init, test, increment)
      ...
   #end
would be changed to
   init
   #while (test)
      ...
      increment
   #end
but I don't know how easily that applies to POV parsing, probably not at
all.

> Unknown. I have written a patch which adds a ^ operator for
> exponentiation, but it may not be included. The modulo operator would be
> just as easy...but the best operator to use for it would be %, and that
> is already used in MegaPOV as a shortcut for #local. Both of these
> operators are useable in functions, however.

Yeah! No typing '#local' anymore! I'll probably do it anyway...

--
David Fontaine   <dav### [at] faricynet>   ICQ 55354965
Please visit my website:  http://davidf.faricy.net/


Post a reply to this message

From: Chris Huff
Subject: Re: POV Parsing
Date: 2 Sep 2000 14:03:44
Message: <chrishuff-230BA8.13052102092000@news.povray.org>
In article <39B### [at] faricynet>, David Fontaine 
<dav### [at] faricynet> wrote:

> From a preprocessor perspective,
>    #for(init, test, increment)
>       ...
>    #end
> would be changed to
>    init
>    #while (test)
>       ...
>       increment
>    #end
> but I don't know how easily that applies to POV parsing, probably not at
> all.

I don't think it would be very easy, if at all possible, to convert a 
#for loop to a #while loop. It would probably be best to implement a 
completely separate loop. However, I don't know that part of the 
source(yet), so I could easily be wrong.


> Yeah! No typing '#local' anymore! I'll probably do it anyway...

Do what? Type #local?
BTW, those shortcuts won't make it into 3.5, since they don't work quite 
right, so maybe % *can* eventually be used as a modulus operator.

-- 
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: Peter J  Holzer
Subject: Re: POV Parsing
Date: 3 Sep 2000 10:00:38
Message: <slrn8r4kp7.g94.hjp-usenet@teal.h.hjp.at>
On 30 Aug 2000 09:51:17 -0400, Warp wrote:
>Peter J. Holzer <hjp### [at] sikituwsracat> wrote:
>: Indeed. If you compute this with standard 32 bit integer arithmetic, the
>: result is 925. Probably not what you had in mind. 
>
>  I didn't check if the values would fit into a 32-bit integer, but you get
>the idea.
>  And if integers are ever implemented in povray, there should be a very long
>integer type (at least 64 bits) anyways :)

In which case the space advantage of integers would vanish. 
They would only have a slight accuracy advantage (63 instead of 53 bits
"mantissa"). The speed difference is probably negligible.

I really don't see any advantage in introducing integers in povray. 

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Peter J  Holzer
Subject: Re: POV Parsing
Date: 3 Sep 2000 10:00:39
Message: <slrn8r4l2a.g94.hjp-usenet@teal.h.hjp.at>
On Thu, 31 Aug 2000 23:20:44 -0500, Chris Huff wrote:
>In article <39AF1FCD.4B0CE825@faricy.net>, David Fontaine 
><dav### [at] faricynet> wrote:
>
>> And where's the stinkin' #for? :)
>
>Now, *this* I have no idea how to implement, though I would use a 
>C/Java-like syntax instead of the BASIC-like syntax.

Since a C for loop:

for (A; B; C) {
    D;
}

is just an abbreviation for

A;
while(B) {
    D;
    C;
}

(well, if you ignore continue, anyway)
and we already have a while loop in Povray, that shouldn't be too hard.

>The modulo operator would be just as easy...but the best operator
>to use for it would be %, and that is already used in MegaPOV as a
>shortcut for #local.

Oh. I didn't notice that. Cool! I always thought that redeclaring a
variable at every assignment is somewhat inelegant.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Chris Huff
Subject: Re: POV Parsing
Date: 3 Sep 2000 11:04:38
Message: <chrishuff-5DABD7.10061703092000@news.povray.org>
In article <slr### [at] tealhhjpat>, 
hjp### [at] SiKituwsracat (Peter J. Holzer) wrote:

> Since a C for loop:
...
> is just an abbreviation for
...
> (well, if you ignore continue, anyway)
> and we already have a while loop in Povray, that shouldn't be too hard.

It might not be easy to internally convert a for loop to a while loop, 
it may require a completely separate loop.


> Oh. I didn't notice that. Cool! I always thought that redeclaring a
> variable at every assignment is somewhat inelegant.

That shortcut still redeclares the variable, it is just a typing 
shortcut, but I agree that it is inelegant to redeclare a variable just 
to assign to it. That is the exact reason I added a #set keyword in my 
patch, so you can use a separate keyword for modifying variables.

-- 
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

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

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