POV-Ray : Newsgroups : povray.beta-test : macros without commas takes parameter wrongly Server Time
30 Jul 2024 04:18:31 EDT (-0400)
  macros without commas takes parameter wrongly (Message 1 to 3 of 3)  
From:
Subject: macros without commas takes parameter wrongly
Date: 25 Jan 2002 04:48:22
Message: <bp925u4upa1gl9kih2pikg4qusf0lr03kg@4ax.com>
POV 3.5 b 10 on WinNT Sp 6 PII 233 with 128 MB
POV 3.5 b 10 on Win 95 OSR-2 PII 233 with 128 MB

If you run below macro:

//
#include "strings.inc"
#macro A(R T S)
  #debug concat(Vstr(R,0,1)"\n")
  #debug concat(Vstr(T,0,1)"\n")
  #debug concat(Vstr(S,0,1)"\n")
#end
#macro S(T k)A(0,T,k)#end
S(2*y,1)
S(0<.6,.2,1>)
S(-x<.3,.8,2>)
//

then script outputs all parameters unrolled:

<0.0,0.0,0.0>
<0.0,2.0,0.0>
<1.0,1.0,1.0>
<0.0,0.0,0.0>
<0.0,0.0,0.0>
<0.6,0.2,1.0>
<0.0,0.0,0.0>
<-1.0,0.0,0.0>
<0.3,0.8,2.0>

but when you replace line
#macro S(T k)A(0,T,k)#end
with
#macro S(T k)A(0 T k)#end
(only difference are commas replaced with spaces)
then parser ignores third macro parameter 'k' and output is different

<0.0,0.0,0.0>
<1.0,1.0,1.0>
<1.0,1.0,1.0>
<0.0,0.0,0.0>
<0.6,0.2,1.0>
<0.6,0.2,1.0>
<0.0,0.0,0.0>
<0.3,0.8,2.0>
<0.3,0.8,2.0>

Note it is only connected with commas in macro calling. No problem with
commas/spaces in macro definition.

Any confirmation ?

ABX


Post a reply to this message

From: Arthur Flint
Subject: Re: macros without commas takes parameter wrongly
Date: 25 Jan 2002 07:45:49
Message: <Xns91A14EEEB5377mrartchesapeakenet@204.213.191.226>

news:bp925u4upa1gl9kih2pikg4qusf0lr03kg@4ax.com:
Confirmed:
Win98se PII 400 198mb ram beta10


-- 
Gis poste, Arto.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: macros without commas takes parameter wrongly
Date: 25 Jan 2002 14:07:01
Message: <3c51acd5$1@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> (only difference are commas replaced with spaces)

Just leave the commas there.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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