POV-Ray : Newsgroups : povray.general : macro - without () Server Time
5 Aug 2024 16:12:45 EDT (-0400)
  macro - without () (Message 21 to 30 of 34)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Christopher James Huff
Subject: Re: macro - without ()
Date: 2 Oct 2002 14:16:00
Message: <chrishuff-FEA270.14131802102002@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> macro() Vs define is much shorter, macro() Vs macro is a little bit 
> shorter, but on the other hand it's probably easy to implement

The "rgbft" part is completely unnecessary, and even the "color" is 
optional. You are using the longest possible way to specify colors in 
your comparison. POV's syntax already allows you to make it as short as 
the shortest example you gave.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: macro - without ()
Date: 2 Oct 2002 14:22:59
Message: <chrishuff-F5B80A.14201702102002@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> Would it be a big problem to allow syntax  :
> 
> #macro finWater1 reflection { .01 .2 } #end
> finish { finWater1 }
> 
> instead of  finish { finWater1() }
> 
> this is a small change [probably] and shorten syntax is more comfortable

It isn't such a small change...you seem to assume that about anything. 
I'm betting that POV uses the "(" to determine it is calling a macro or 
function, and it makes a very helpful visual indicator as well. Your 
version is shorter by one () pair...typing is not really any faster, and 
readability is much worse, you have no way to tell a macro call from a 
variable identifier. It also kills the possibility of passing a macro 
parameter as a parameter in some future version without some weird 
syntax.
Stop counting keystrokes, it is a stupid and useless exercise, and one 
you seem to be obsessed with.


> btw. this will make pov macros act more like C preprocesor macros

That isn't necessarily a good thing. POV macros are not C preprocessor 
macros.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: macro - without ()
Date: 2 Oct 2002 14:23:43
Message: <chrishuff-9D9CC9.14210202102002@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> and another request, in connection with previous post - keyword ignore
> that can be added to any object. It will 'kill' the object.

That is just idiotic. Comment out the stupid object!

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: gilroy
Subject: Re: macro - without ()
Date: 2 Oct 2002 17:15:15
Message: <web.3d9b60cbc85d9e9068a1676e0@news.povray.org>
Rafal 'Raf256' Maj wrote:
>"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in
>news:Xns### [at] 204213191226
>
>> Would it be a big problem to allow syntax  :
>
>and another request, in connection with previous post - keyword ignore
>that can be added to any object. It will 'kill' the object.
>
>Why ?
>Simple - it's very usefull while i.e. 'debugging' scene - if I have object
>long at 100 lines like :
>difference { ... union { ... } merge { ... union { ... }
>  ...
>  ignore
>}
>addning / removing "ignore" is much faster then commenting all 100 lines or
>putting them into  #if (0) ... #end

If this is really an issue, couldn't you just #declare the object, then
comment out the call?  That is, instead of
sphere { <0,0,0>, 1 color Green ignore}

you'd write

#declare MySphere =
    sphere {<0,0,0>, 1 color Green}

object {MySphere} // to show it
//object (MySphere) // to hide it

With the added advantage that it's easy to abstract the object definition to
an #include file and then just use the call to include the object.


Post a reply to this message

From: Pabs
Subject: Re: macro - without ()
Date: 3 Oct 2002 02:49:45
Message: <3D9BE741.7359C354@nospam_zip.to>
I put the following lines around objects to remove them
/*
// */
and add an extra slash to put them back
//*
// */
You could also do the same with #if(0)/#if(1)

Bye,
Pabs


Post a reply to this message

From: John VanSickle
Subject: Re: macro - without ()
Date: 3 Oct 2002 14:37:02
Message: <3D9C8E55.221670BE@hotmail.com>
Rafal 'Raf256' Maj wrote:
> 
> Would it be a big problem to allow syntax  :
> 
> #macro finWater1 reflection { .01 .2 } #end
> finish { finWater1 }
> 
> instead of  finish { finWater1() }
> 
> this is a small change [probably] and shorten syntax is more comfortable
> 
> btw. this will make pov macros act more like C preprocesor macros

Is there a scene you can't render because of this?  If not, the
POV-Ray team have bigger fish to fry.

Regards,
John


Post a reply to this message

From: Jellby
Subject: Re: macro - without ()
Date: 3 Oct 2002 15:50:16
Message: <3d9c9f77@news.povray.org>
Rafal 'Raf256' Maj wrote:

> "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in
> news:Xns### [at] 204213191226
> 
>> Would it be a big problem to allow syntax  :
> [...]
> 
> and another request, in connection with previous post - keyword ignore
> that can be added to any object. It will 'kill' the object.
> 
> Why ?
> Simple - it's very usefull while i.e. 'debugging' scene - if I have object
> long at 100 lines like :
> difference { ... union { ... } merge { ... union { ... }
>   ...
>   ignore
> }
> addning / removing "ignore" is much faster then commenting all 100 lines
> or
> putting them into  #if (0) ... #end
> 
> 
> Why connection with no "()" macros ? because creating ignore keyword can
> be done in POV already :
>   #macro ignore() translate 1e50 #end
>   (this will work for most objects)
> But it must be used as :
>   object { ... ignore() }   instead of :
>   object { ... ignore }
> (without no-()-macros syntax)
> 
> 

What about scale 0 (or 1e-50)? Is this prohibited? does this give errors? It 
maybe wouldn't work with infinite objects, but it might be useful.


Post a reply to this message

From: Christopher James Huff
Subject: Re: macro - without ()
Date: 3 Oct 2002 19:29:13
Message: <chrishuff-5345CF.19254803102002@netplex.aussie.org>
In article <3d9c9f77@news.povray.org>,
 Jellby <jel### [at] M-softhomenet> wrote:

> What about scale 0 (or 1e-50)? Is this prohibited? does this give errors? It 
> maybe wouldn't work with infinite objects, but it might be useful.

Forbidden, you can't scale by 0, or any other size lower than EPSILON, 
on any dimension. You could scale it very small, but the effects will be 
dependant on the original size, and it will still take processing power. 
If you want to temporarily remove an object, the best way is to simply 
comment it out. I don't understand the reasoning behind looking for 
worse ways to do the same thing.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: macro - without ()
Date: 4 Oct 2002 06:52:51
Message: <Xns929D82C0E5138raf256com@204.213.191.226>
Jellby <jel### [at] M-softhomenet> wrote in
news:3d9c9f77@news.povray.org 

> What about scale 0 (or 1e-50)? Is this prohibited? does this give
> errors? It maybe wouldn't work with infinite objects, but it might be
> useful. 

i.e.
scale x*a = scale <a,0,0> 
is interpreted like scale  <a,1,1>

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: macro - without ()
Date: 4 Oct 2002 06:54:39
Message: <Xns929D830D1122Braf256com@204.213.191.226>
John VanSickle <evi### [at] hotmailcom> wrote in 
news:3D9C8E55.221670BE@hotmail.com

> Is there a scene you can't render because of this?  If not, the
> POV-Ray team have bigger fish to fry.

I don't agree with this philosofi - what about i.e. new POV-logo, auto-
completition-of-keywords (ctrl_space), new insert mewnu etc.


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


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.