POV-Ray : Newsgroups : povray.beta-test : #error bug Server Time
31 Jul 2024 02:23:08 EDT (-0400)
  #error bug (Message 4 to 13 of 43)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Redbeard (MDJohnson)
Subject: Re: #error bug
Date: 20 Oct 2001 09:39:16
Message: <3bd17e84@news.povray.org>
"Rune" <run### [at] mobilixnetdk> wrote in message
news:3bd16402@news.povray.org...
> "Thorsten Froehlich" wrote:
> > This is a documentation problem IMO.  As the error is
> > "caused" by the user POV-Ray should really not print it
> > out because this would make it look like _POV-Ray_
> > generated the error, which is not true.
>
> What???
>
> So does it also look like POV-Ray is making all #debug and #warning
> messages?
>
> I don't get your reasoning. Please tell me again why creators of include
> files should not have the ability to output an instructive error message to
> the user. The pane can still say "Parse Error: User error directive hit."
> but it should also print the string so the user can know what the error is.
>

I concur.  For a while I was writing #warning messages followed by #error to
stop the parse.  But that means two lines of code where one should suffice.

IMO, if #error doesn't print the string it's passed, it shouldn't require a
string.  So, either the requirement should be used or the string should be
printed after being parsed.

BTW, if you omit the string, the following error occurs:
File: C:\My Documents\POVRay\Test\error.pov  Line: 1
#error

 <----ERROR

Parse Error: Expected 'string expression', End of File found instead


Returned from renderer with error status

Michael


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #error bug
Date: 20 Oct 2001 10:29:11
Message: <3bd18a37@news.povray.org>
In article <3bd16402@news.povray.org> , "Rune" <run### [at] mobilixnetdk>
wrote:

> I don't get your reasoning. Please tell me again why creators of include
> files should not have the ability to output an instructive error message to
> the user.

Because the error messages tend to be assumed to come from POV-Ray most of
the time.  This is even true for warnings, but as those don't stop POV-Ray
people who don't understand the difference will just wonder but hardly ever
complain.  With an error message on the other hand, especially one that
cannot be found in the scene file it is far less likely people will
understand why they got an error because POV-Ray is pointing at one place
but showing a completely different message.

Let me give you an example question I expect to show up in p.newusers within
a few weeks after the error output would have been changed:

>>
Help!  POV-Ray doesn't like my aspect ratio whatever that is!  It says
"Parse Error: User error directive hit. Your aspect ratio will not work with
this scene!"  What am i doing wrong?
<<

I know, I know, I should not make such assumptions and because #error
directives are rare we might not see many of these problems reported, but I
am sure that we will see 50% of *all* #error problems being reported while
we might only see 0.1% of all #warning directive problems being reported
simply because a warning is something a user can ignore but an error he/she
has to deal with!


    Thorsten


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #error bug
Date: 20 Oct 2001 10:31:15
Message: <3bd18ab3$1@news.povray.org>
In article <3bd17e84@news.povray.org> , "Redbeard \(MDJohnson\)" 
<red### [at] wvadelphianet> wrote:

> IMO, if #error doesn't print the string it's passed, it shouldn't require a
> string.

An #error should not allow a string, but enforce a quoted "something".  This
is necessary so one at least has a chance to find out what the #error is
about without having to read the whole scene file.

    Thorsten


Post a reply to this message

From: Rune
Subject: Re: #error bug
Date: 20 Oct 2001 10:51:14
Message: <3bd18f62@news.povray.org>
"Thorsten Froehlich" wrote:
> "Redbeard (MDJohnson)" wrote:
>
> > IMO, if #error doesn't print the string it's passed,
> > it shouldn't require a string.
>
> An #error should not allow a string,

But it requires a string. That must be a bug then?

> but enforce a quoted "something".

A quoted "something" that is not a string? How do you define this in clear
terms?

> This is necessary so one at least has a chance to find
> out what the #error is about without having to read the
> whole scene file.

Perhaps the word you're looking for is "comment". However, comments have a
different syntax which is // or /* */

As it is now there's clearly something wrong as the directive requires a
string but doesn't use it for anything.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #error bug
Date: 20 Oct 2001 11:51:54
Message: <3bd19d9a@news.povray.org>
In article <3bd18f62@news.povray.org> , "Rune" <run### [at] mobilixnetdk>
wrote:

>> An #error should not allow a string,
>
> But it requires a string. That must be a bug then?
>
>> but enforce a quoted "something".
>
> A quoted "something" that is not a string? How do you define this in clear
> terms?

There are two different definitions of "string" we are talking about.  The
firs one is what POV-Ray allows as a function that defines a string, which
in the POV-Ray parser syntax is simply called "STRING".  The second
definition, which I called "quoted something" is simply anything that may
appear between two quotes, but no functions or other tokens.

To show it by example, the following should be legal:

#error "My message"
#error ""
#error "abc"

While these should be illegal:

#error foo
#error this is the error message
#error

The reasoning behind this being a) that the error message is easier to find
in the complex POV-Ray syntax because it gets colored in the most common
editors used to edit pov files and b) that it is easy to find the end of the
error message simply by looking for the second quote so POV-Ray can gibe the
error location at the end of the #error line.

I should note that b) is also the reason why it currently takes a string -
this way the error will point to the end of the #error directive message
rather than the beginning.

    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

From: Rune
Subject: Re: #error bug
Date: 20 Oct 2001 14:25:23
Message: <3bd1c193@news.povray.org>
And I repeat:

POV-Ray *does* allow a pre-defined string to be used. You said that it
shouldn't allow a pre-defined string to be used*. So that must be a bug?

* quote from Thorsten:

"An #error should not allow a string, but enforce a quoted "something"."

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #error bug
Date: 20 Oct 2001 14:59:35
Message: <3bd1c997@news.povray.org>
In article <3bd1c193@news.povray.org> , "Rune" <run### [at] mobilixnetdk>
wrote:

> So that must be a bug?

No, because the documentation never says that the #error string is printed
to the #error stream and the documentation matches what POV-Ray does.  Of
course this does not mean it is the best way to do it or that this
particular part of the documentation is perfect, but an incomplete
specification isn't a bug.  Oh, and note that the error message is actually
displayed once already in the line showing with the #error directive...

    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

From: Rune
Subject: Re: #error bug
Date: 20 Oct 2001 20:57:55
Message: <3bd21d93@news.povray.org>
"Thorsten Froehlich" wrote:
> "Rune" wrote:
>
> > So that must be a bug?
>
> No, because the documentation never says that the
> #error string is printed to the #error stream

Yes it does.

"There are seven distinct text streams that POV-Ray uses for output. You may
output only to three of them."

Look, no matter how you put it there is a bug*, and not just in the
documentation.

If the error directive is supposed to only accept quoted text, but not
pre-defined strings, then there's a bug because it does accept pre-defined
strings.

If the error directive is supposed to accept any string, including
pre-defined strings, then there's a bug because the string is not used for
anything at all, and thus the user don't see the string.

> Oh, and note that the error message is actually displayed
> once already in the line showing with the #error directive...

Not if the error message is a pre-defined string.

* Of course I don't have the final saying in this, but I haven't yet seen
any arguments that indicate otherwise.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #error bug
Date: 21 Oct 2001 04:22:56
Message: <3bd285e0@news.povray.org>
In article <3bd21d93@news.povray.org> , "Rune" <run### [at] mobilixnetdk>
wrote:

>> No, because the documentation never says that the
>> #error string is printed to the #error stream
>
> Yes it does.
>
> "There are seven distinct text streams that POV-Ray uses for output. You may
> output only to three of them."

You generate output to the error stream in form of the line quoted by the
"<-- Error" message which dumps the line with the error message.  And note
that the documentation says nothing about actually outputting the string
behind the error message.  In fact after reading it several times I get the
impression the documentation is doing more than just explain the use of text
streams.  It also tells you what those text streams are and that you get a
parse error when using the #error directive.  It never says there can't be a
render time output with these directives, which of course is nonsense.

> If the error directive is supposed to only accept quoted text, but not
> pre-defined strings, then there's a bug because it does accept pre-defined
> strings.

No, because the documentation and the behavior of POV-Ray match in all clear
areas of the documentation.  As the documentation is not clear what happens
with the output, it is up to the user interpretation.

I do agree with you that the situation needs to be improved.


    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

From: Warp
Subject: Re: #error bug
Date: 21 Oct 2001 04:34:01
Message: <3bd28879@news.povray.org>
About this discussion about the #error directive:

  Also I think that POV-Ray should print the string given to #error.

  Suppose that you have a macro like this, which takes a parameter which
should be a float value which is >=0 and <1:

#macro FancyMacro(Value)
  #if(Value<0 | Value>=1)
    #error concat("In FancyMacro(): Given parameter value ",
                  str(Value,0,-1),
                  " is out of range.\n")
  #end
  
  // Do something fancy here
#end

  And now suppose that you make a slight mistake when calling it:

#declare Ind = 0;
#while(Ind <= 10)
  FancyMacro(Ind/10)
  #declare Ind = Ind+1;
#end

  Now, which error message is clearer, the one POV-Ray currently gives:


File: C:\somepath\somefile.pov  Line: 5
                  str(Value,0,-1),

                  " is out of range.\n") <----ERROR

Parse Error: User error directive hit.


or what POV-Ray *should* print:


File: C:\somepath\somefile.pov  Line: 5

In FancyMacro(): Given parameter value 1 is out of range.

Parse Error: User error directive hit.


  And this does not look like an error message given by POV-Ray itself.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>

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