POV-Ray : Newsgroups : povray.general : Empty value for variable Server Time
25 Apr 2024 04:07:08 EDT (-0400)
  Empty value for variable (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: yesbird
Subject: Re: Empty value for variable
Date: 6 Feb 2023 13:45:00
Message: <web.63e14a775d560c7480f94ee210800fb2@news.povray.org>
Sorry, solution was:
-------------------
_vector(1,,    ) // OK
-------------------
Number of commas is matter

--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Empty value for variable
Date: 6 Feb 2023 14:10:00
Message: <web.63e150485d560c741f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Sorry, solution was:
> -------------------
> _vector(1,,    ) // OK
> -------------------
> Number of commas is matter
>
> --
> YB

Yes, and that's why I find that method awkward.

There's also no way to write a macro with a variable number of arguments - it
has to be fixed.

But now that we have dynamic arrays, and indeed, mixed arrays, I think I'd opt
for passing an array of arguments in, and then having the macro analyze and
process the array.

We still don't have any means of checking what the data type is without aborting
the parsing phase with an error, so just be aware of that as well.

- BE


Post a reply to this message

From: jr
Subject: Re: Empty value for variable
Date: 7 Feb 2023 01:15:00
Message: <web.63e1eb8d5d560c7488a828ca6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "yesbird" <nomail@nomail> wrote:
> > Sorry, solution was:
> > -------------------
> > _vector(1,,    ) // OK
> > -------------------
> > Number of commas is matter
> > YB

yes, optional value(s), not position(s).


> Yes, and that's why I find that method awkward.

for YB's benefit, I think that may be just because the parser is so .. lenient
elsewhere.  as you know, much POV-Ray code published here "skimps" on detail,
the ';' terminator is rarely used (or "taken serious" even, I feel), meshes and
such often omit the commas between neighbouring vector values etc.  in fact,
'box {your ears}' would have sufficed ;-).  with the macro it's simply that
w/out the commas, the parser would have no (literal) clue which of the args were
omitted.


> There's also no way to write a macro with a variable number of arguments - it
> has to be fixed.
> But now that we have dynamic arrays, and indeed, mixed arrays, I think I'd opt
> for passing an array of arguments in, and then having the macro analyze and
> process the array.

yes.  (dictionaries, too)


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Empty value for variable
Date: 7 Feb 2023 06:40:00
Message: <web.63e237c35d560c741f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> for YB's benefit, I think that may be just because the parser is so .. lenient
> elsewhere.  as you know, much POV-Ray code published here "skimps" on detail,
> the ';' terminator is rarely used (or "taken serious" even, I feel), meshes and
> such often omit the commas between neighbouring vector values etc.

This is true, and we have some benefits and some hardships because of that.
We have lazy programming practices, black-box variable types and unknown
castings, parser "surprises", and bits of mystery code and loose ends all over
the internals.

>  in fact,
> 'box {your ears}' would have sufficed ;-).


Oh, hardly.  There are days where you are simply unruly to the point where we
don't even know where to start figuring out what to do with you.   :P

  with the macro it's simply that
> w/out the commas, the parser would have no (literal) clue which of the args were
> omitted.

Indeed.  No idea how such things are typically handled in other languages.


> > There's also no way to write a macro with a variable number of arguments - it
> > has to be fixed.
> > But now that we have dynamic arrays, and indeed, mixed arrays, I think I'd opt
> > for passing an array of arguments in, and then having the macro analyze and
> > process the array.

> yes.  (dictionaries, too)

See?   Positively flabbergasting.   An in public, no less.
You and your Dark Magic.

../jrEvilSpells.sh >/dev/null 2>&1


Post a reply to this message

From: yesbird
Subject: Re: Empty value for variable
Date: 7 Feb 2023 09:05:00
Message: <web.63e25a105d560c74164c19e610800fb2@news.povray.org>
Hi,
> yes.  (dictionaries, too)

Thanks, they much more convenient to me.
--
YB


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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