POV-Ray : Newsgroups : povray.unofficial.patches : MegaPOV quirks and questions.. Server Time
2 Sep 2024 06:16:02 EDT (-0400)
  MegaPOV quirks and questions.. (Message 10 to 19 of 29)  
<<< Previous 9 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 05:36:47
Message: <397d5fae@news.povray.org>
Gail Shaw <gsh### [at] monotixcoza> wrote:
: Depends. If you play with the mathematics it can be proved that
: x/0 = infinity where x!= 0

  Nope:

-1/0 = -infinity

-- 
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: Gail Shaw
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 06:40:00
Message: <397d6e80@news.povray.org>
Warp wrote in message <397d5fae@news.povray.org>...
>Gail Shaw <gsh### [at] monotixcoza> wrote:
>: Depends. If you play with the mathematics it can be proved that
>: x/0 = infinity where x!= 0
>
>  Nope:
>
>-1/0 = -infinity


picky :-)

Ok x/0 = infinity where x>0 and x/0 = -infinity where x<0

Gail
********************************************************************
* gsh### [at] monotixcoza              * Reality.dat not found         *
* http://www.rucus.ru.ac.za/~gail/ * Attempting to reboot universe *
********************************************************************
* The best way to accelerate Windows NT is at 9.8 m/s^2      *
********************************************************************


Post a reply to this message

From: Alex Vandiver
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 09:03:21
Message: <397D8F55.F460E295@tiac.net>
Thorsten Froehlich wrote:

> Yes it can:
>
> #macro b_version1()
>   // do one thing
> #end // macro b, first possibility
>
> #macro b_version2()
>   // do something else
> #end // macro b, second possibility
>
> #macro a(foo)
>   #if (foo)
>     // call b_version1
>   #else
>     // call b_version2
>   #end // if statement
> #end // macro a

No -- you're missing the point.  The version I wrote leaves a macro, b(),
defined after a(foo) closes, which is dependant on what foo was at the time
a(foo) was called.  What you've got above will _call_ a version once, dependent
on foo, but macros etc after the fact will not themselves be able to call b()
and get a "dynamic" macro.
-Alex V.


Post a reply to this message

From: Ron Parker
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 09:31:23
Message: <slrn8nr6bi.hf7.ron.parker@fwi.com>
On 25 Jul 2000 05:36:47 -0400, Warp wrote:
>Gail Shaw <gsh### [at] monotixcoza> wrote:
>: Depends. If you play with the mathematics it can be proved that
>: x/0 = infinity where x!= 0
>
>  Nope:
>
>-1/0 = -infinity

This is a question of geometry. Some would claim that -infinity == infinity.

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


Post a reply to this message

From: pk
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 10:16:31
Message: <397DA192.8DEDB5DF@videotron.ca>
Ron Parker wrote:
> 
> On 25 Jul 2000 05:36:47 -0400, Warp wrote:
> >Gail Shaw <gsh### [at] monotixcoza> wrote:
> >: Depends. If you play with the mathematics it can be proved that
> >: x/0 = infinity where x!= 0
> >
> >  Nope:
> >
> >-1/0 = -infinity
> 
> This is a question of geometry. Some would claim that -infinity == infinity.
Lol.... especially computers ;-)
And, uh, where can i find Colefax's Macros?? I sorta lost the link, i
think 8(
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Chris Huff
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 11:02:08
Message: <chrishuff-6F8CEE.10024925072000@news.povray.org>
In article <397DA192.8DEDB5DF@videotron.ca>, pk <thi### [at] videotronca> 
wrote:

> And, uh, where can i find Colefax's Macros?? I sorta lost the link, i
> think 8(

Let's see if I can beat The Ken. :-)
http://www.geocities.com/ccolefax/

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Margus Ramst
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 11:41:15
Message: <397DA722.A87A6A01@peak.edu.ee>
Alex Vandiver wrote:
> 
> No -- you're missing the point.  The version I wrote leaves a macro, b(),
> defined after a(foo) closes, which is dependant on what foo was at the time
> a(foo) was called.

Then how about this:

#macro a(foo)
   #if (foo)
     #declare Switch=1;
   #else
     #declare Switch=0;
   #end
#end

#if(Switch)
   #macro b()
      // do one thing
   #end
#else
   #macro b()
      // do another thing
   #end
#end

-- 
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: MegaPOV quirks and questions..
Date: 25 Jul 2000 11:43:05
Message: <397DA790.69CECA82@peak.edu.ee>
Warp wrote:
> 
> It can return some value, it can terminate the program with an
> error, it can draw a nude woman on your screen...

... it can empty your bank account, format your HD, run away with your wife...
You've lost all your privileges now, boy.

-- 
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: MegaPOV quirks and questions..
Date: 25 Jul 2000 12:10:46
Message: <chrishuff-4FCD98.11111925072000@news.povray.org>
In article <397DA722.A87A6A01@peak.edu.ee>, Margus Ramst 
<mar### [at] peakeduee> wrote:

> #macro a(foo)
>    #if (foo)
>      #declare Switch=1;
>    #else
>      #declare Switch=0;
>    #end
> #end
> 
> #if(Switch)
>    #macro b()
>       // do one thing
>    #end
> #else
>    #macro b()
>       // do another thing
>    #end
> #end

In that case, you have to use that #if() statement after every time you 
call a(). Not very user-friendly...a better solution would be this:

// set a "default" macro
#declare Switch = 1;

#macro B1(foo)...#end
#macro B2(foo)...#end

#macro A(Foo)
    #if(Foo)
        #declare Switch = 1;
    #else
        #declare Switch = 2;
    #end
#end


// Code which would be calling B() if nested declarations were allowed.
#if(Switch == 1)
    B1(Foo)
#else
    B2(Foo)
#end

And of course, for more than two versions of the macro, you simply use a 
#switch() statement. You could even put this in yet another macro, to 
hide the fact that one of several macros is being picked, like this:
#macro B(Bar)
    #if(Switch == 1)
        B1()
    #else
        B2()
    #end
#end

Another possible workaround would be to put the macros in separate 
include files, and have a macro include different files depending on 
which one you want. You can't nest a #macro within a #macro, but maybe 
you can nest a #macro within an #include within a #macro...I haven't 
actually tried it, though, and it seems like a messy way to code.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ron Parker
Subject: Re: MegaPOV quirks and questions..
Date: 25 Jul 2000 12:14:51
Message: <slrn8nrfu3.hio.ron.parker@fwi.com>
On Tue, 25 Jul 2000 17:41:38 +0300, Margus Ramst wrote:
>Alex Vandiver wrote:
>> 
>> No -- you're missing the point.  The version I wrote leaves a macro, b(),
>> defined after a(foo) closes, which is dependant on what foo was at the time
>> a(foo) was called.
>
>Then how about this:
>
>#macro a(foo)
>   #if (foo)
>     #declare Switch=1;
>   #else
>     #declare Switch=0;
>   #end
>#end
>
>#if(Switch)
>   #macro b()
>      // do one thing
>   #end
>#else
>   #macro b()
>      // do another thing
>   #end
>#end

Still not the same.  Something like this would be, though:

#macro a(foo)
  #declare Switch=foo;
#end

#macro b()
  #if (Switch)
    // do one thing
  #else
    // do another thing
  #end
#end

but, perversely, I find the nested macro solution somehow more elegant.
For one thing, it uses one less entry in the global symbol table.  For
another, it parses more quickly, particularly if you'll be calling b a
lot.

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


Post a reply to this message

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

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