octave-maintainers
[Top][All Lists]
Advanced

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

Re: WTF bug ID


From: John W. Eaton
Subject: Re: WTF bug ID
Date: Sat, 20 Dec 2014 08:42:01 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

On 12/20/2014 06:53 AM, Philipp Kutin wrote:
On Fri, Dec 19, 2014 at 6:31 PM, Rik <address@hidden> wrote:
I remember being unhappy about having that implemented at the time, but whatever.  I had 
added a note at the bottom of the docstring for error to try and warn people about this 
("two or more input arguments")

While the behavior is somewhat strange, there's a certain logic to it.
Since in the M language, escapes like '\n' have no meaning at the
lexical level and are merely interpreted by sprintf() and the like at
runtime, a mnemonic for error() usage can be that for more than one
inarg, the first one is a format string, and it's plain otherwise.

Then why not just ALWAYS pass the format string through sprintf? That would be a much simpler rule.

But even if we agree that it makes sense that the presence of extra arguments controls whether sprintf-style formatting is used, it seems really strange that the error ID counts as an extra argument.

And don't even get me started on how the error ID detection works...

:-)

jwe




reply via email to

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