octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Standarizing Octave:* warnings and errors ID


From: Juan Pablo Carbajal
Subject: Standarizing Octave:* warnings and errors ID
Date: Sun, 28 Oct 2012 07:56:47 +0100

Hi,

I would like to propose the creation of a "global" container of
Octave:* IDs for warning and errors. The ideal would be a dictionary,
but we do not have this data type so we can implement a function.

Now, to have them available in C++ code we need this function to be a
C++ function, right?

The interface I was thinking of is something like:

msgID (key)

where the only argument "key"
- can be an integer, in which case the string returned is extracted
from a list of strings ordered alphabetically.
- can be a string, in which case it is used as an identifier of the
ID. Example: "Octave:Invalid-fun-call" could be obtained with
msgID("invalid-call").

msgID (key, context)

the optional argument context adds the context to the ID. Examples
misgID ("invalid-call","quadgk") would produce "Octave:quadgk:Invalid-fun-call"
misgID ("invalid-call","quadgk:my_subfunction") would produce
"Octave:quadgk:my_subfunction:Invalid-fun-call"

The second call I am not sure about, since it de-standardizes the ID
and it really doesn't give more information since the warning and the
error will give the position where the error/warning was rised. (In
this regard the patch I send for quadgk.m may have to be changed).

What do you think?
What would be the best way of implementing something like this?

Thx


reply via email to

[Prev in Thread] Current Thread [Next in Thread]