POV-Ray : Newsgroups : povray.general : Array and Macro problem (again) : Re: Array and Macro problem (again) Server Time
2 Aug 2024 22:18:27 EDT (-0400)
  Re: Array and Macro problem (again)  
From: Thorsten Froehlich
Date: 19 Aug 2004 07:20:14
Message: <41248cee@news.povray.org>
In article <412486bc$1@news.povray.org> , Tor Olav Kristensen 
<tor### [at] TOBEREMOVEDhotmailcom>  wrote:

> Hmmm... I see that it works when I add a semicolon,
> but I can not see any error messages or warnings about
> a missing semicolon.

This has nothing to do with the array declaration per se and no warning
should be expected either.  It has to do with the declaration being returned
before POV-Ray can know that it is complete.  This applies to all
declarations.  If you would add another declare or anything else prior to
returning the just declared value, POV-Ray would also know that your
declaration was complete.  The semicolon is indeed optional if you do not
need it to disambiguate your statement, but POV-Ray cannot guess what you
intended in an ambiguous case.  Consequently, adding the semicolon makes
clear what you want to do and the macro works properly.

This is what the manual states as you quoted it.  It is not possible to list
all possibly ambiguous cases one can create that do require a semicolon.
Hence the manual only tells you to add it when a macro does not work as
expected.  The error message actually says this implicitly as it tells you
"AA" is not initialized, because that is indeed the case.  Together with the
manual that implies a semicolon finalizes any declaration, adding the
semicolon is the logical course of action.

I agree that this concept is not easy to understand, but it is entirely
logical once you fully understood the concept of declarations and how macros
return values.

    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.