POV-Ray : Newsgroups : povray.beta-test : strange concatenation rules : Re: strange concatenation rules Server Time
30 Jul 2024 22:22:25 EDT (-0400)
  Re: strange concatenation rules  
From: Bob H 
Date: 24 Sep 2001 13:11:01
Message: <3baf6925@news.povray.org>

news:rvduqtkorh4jdp1a548pf7ruqaqg4t4mtm@4ax.com...
> On Mon, 24 Sep 2001 08:39:18 -0500, "Bob H." <omn### [at] msncom>
> wrote:
> >
> > I don't see a problem, you just need to use comma separation.
>
> but I see the problem
>
> I found this playing with Parse_String macro
>
> I just generated macro with it this way for example
>
> Parse_String(concat(
>   "#macro Name(Params)",
>     :   // here are lines with content of macro
>     :
>   "#end"
> ))
>
> and sometimes I forgot to add comma after lines of string
> and it was parsed ok during concatenation but during Parse_String it
> behave  unexpected
> I found that it lost some lines
>
> I don't think there must be possibility to not use comma
> I just think there should be at least warning that comma required

Yes, I agree.

> > concat() is
> > obviously ignoring the quotes when without commas which turns the "2"
into
> > nothing seen.  So that error of the last example is seeing just a 1 with
> > nothing to concatenate onto it.
>
> I don't say about last line but about all without first !!!
> Question is: why it wasn't reported during parse ? Second string
> (without comma) is always invisible. Third is visible.

I knew that :-) I only pointed out the last example because it kind of
explained the others.

> > Looking at the Scene Help I don't see an example without commas.
>
> Perhaps I missed something but have you seen example without commas
> for sphere{x 1} or triangle{x y z} ?

But those are not strings.  You're dealing with quotes, and a pair of double
quotes must be confusing the parser since it can't decide where the end will
be unless it's the last one seen around a group of characters.

If you wanted a string like """"" you'd do "\"\"\"\"\""

I certainly see your point about the warning being needed for paired quotes.
Seems to me this was a topic I remember from long ago.  If you had a empty
string, for whatever reason, then how would POV know to warn or not?  Except
to warn about any and all such instances...
Hmm, well, maybe like have POV see the first quote and check for closing
quote for only paired off ones.  That way it would move on to the next pair.

Bob H.


Post a reply to this message

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