POV-Ray : Newsgroups : povray.unofficial.patches : POV+for() Server Time
3 Sep 2024 02:19:03 EDT (-0400)
  POV+for() (Message 11 to 20 of 24)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: GrimDude
Subject: Re: POV+for()
Date: 6 May 1999 19:26:27
Message: <37321713.0@news.povray.org>
Aw, what we have now is fine!

I, too, get bit (heh) by things like this. At least you're not doing:

loop:
inc      ax,bitcount
cmp    cx,ax
jne      next_color
inc      cx,01d
jmp     loop

Well, it's been awhile. :)

GrimDude
vos### [at] arkansasnet


Post a reply to this message

From: TonyB
Subject: Re: POV+for()
Date: 7 May 1999 08:40:18
Message: <3732B3AB.107EE235@panama.phoenix.net>
>   I think there's no so much need for a #for statemen, but what I want to
> see in a future version of povray is a do-while statement, like this:

There's always a need for these things. It will allow POVers to be more
creative, and at least, it will help people like me, who think in _for_ and
not in _while_.

> #do
>   (something that will be made at least 1 time)
>   (make some calculations)
> #while(condition)
>
>   It's tedious to type:
>
> (make some calculations)
> #while(condition)
>   (something that will be made at least 1 time)
>   (make the same calculations here)
> #end

I don't understand what you mean about this being easier.

>   And of course some operators would be handy:
>
> #declare Index+=1;
> #declare PosX*=1.5;
> #declare PosY/=2;
> #declare PosZ-=10;

I'm glad you agree. ++ and -- would also come in handy (i.e. less typing).


Post a reply to this message

From: Nieminen Mika
Subject: Re: POV+for()
Date: 7 May 1999 09:36:55
Message: <3732de67.0@news.povray.org>
Phil Clute <pcl### [at] tiacnet> wrote:
: I've always been curious as to why the pov-team chose #declare
: over #define.

  Because #declared identifiers in povray are not macros, while #defined
identifiers in C are macros.
  The #macros in 3.1 work like #defines in C, but naming them as #define
instead of #macro would have been very confusing.

-- 
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 Mika
Subject: Re: POV+for()
Date: 7 May 1999 09:38:43
Message: <3732ded3.0@news.povray.org>
J. Grimbert <jgr### [at] atos-groupcom> wrote:
: init
: #while 
: #if (not first time) 
: calcB
: #end
: calcA
: #end

: I do not see the need for #do/#dowhile

  Still you have to do extra typing, and the code gets slower since there's
one "unnecessary" #if statement to be computed.

-- 
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 Mika
Subject: Re: POV+for()
Date: 7 May 1999 09:42:34
Message: <3732dfba.0@news.povray.org>
And of course the condition of the while-loop may be dependant of
the calculations.

-- 
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: POV+for()
Date: 7 May 1999 10:07:26
Message: <3732e58e.0@news.povray.org>
On Thu, 06 May 1999 23:57:54 +0200, Ralf Muschall wrote:
>Nieminen Mika wrote:
>
>> #declare Index+=1;
>> #declare PosX*=1.5;
>> #declare PosY/=2;
>> #declare PosZ-=10;
>
>Agreed, but I think ++ and -- are not necessary.
>OTOH, I'd like to see the equality operator renamed from
>= to == (I always get bitten by writing something like
>#if(foo==bar)
>and then having to correct it).

Don't forget || and &&.


Post a reply to this message

From: Phil Clute
Subject: Re: POV+for()
Date: 7 May 1999 14:40:47
Message: <37332710.4662E9C6@tiac.net>
Nieminen Mika wrote:
>Because #declared identifiers in povray are not macros, while #defined
>identifiers in C are macros.

I have to admit my experience with C programming is extremely
limited. I guess I am confused as to what a "macro" is then.
I assumed that constants were macros. What makes #define a 
macro and #declare not a macro? They seem to serve the same
purpose.

(There was actually a small discussion in povray.general entitled
"Macro tutorial" started by Andrew Cocker. I mentioned there that
#define and #declare are the same thing. If this is incorrect I
may have mislead Andrew and others.)

-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Rick (Kitty5)
Subject: Re: POV+for()
Date: 7 May 1999 15:35:16
Message: <37333264.0@news.povray.org>
This reminds me, there was a pure ASM rewite of POV 2.2 i think, crashed
everytime for me tho!!

Rick

GrimDude <vos### [at] arkansasnet> wrote in message
news:37321713.0@news.povray.org...
> Aw, what we have now is fine!
>
> I, too, get bit (heh) by things like this. At least you're not doing:
>
> loop:
> inc      ax,bitcount
> cmp    cx,ax
> jne      next_color
> inc      cx,01d
> jmp     loop
>
> Well, it's been awhile. :)
>
> GrimDude
> vos### [at] arkansasnet
>
>


Post a reply to this message

From: Ron Parker
Subject: Re: POV+for()
Date: 7 May 1999 16:20:25
Message: <37333cf9.0@news.povray.org>
On Fri, 07 May 1999 13:46:56 -0400, Phil Clute <pcl### [at] tiacnet> wrote:
>I have to admit my experience with C programming is extremely
>limited. I guess I am confused as to what a "macro" is then.
>I assumed that constants were macros. What makes #define a 
>macro and #declare not a macro? They seem to serve the same
>purpose.

C's #define lets you do
  #define FOO(x,y,z) (x*32+y*z)

which you can then use like a function:

  printf( "%d", FOO(1,2,3) );

whereas #declare creates an actual instance of the specified
object and puts it in a "variable."  #declare is a lot like the
BASIC "Let" statement.

#macro is pretty much the same as #define, but with a little
different syntax.


Post a reply to this message

From: Phil Clute
Subject: Re: POV+for()
Date: 8 May 1999 01:45:27
Message: <3733C2D9.FD4CB069@tiac.net>
Aah I see! Thanks for your help.

-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

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

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