octave-maintainers
[Top][All Lists]
Advanced

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

[Changeset] Compatibility fix for assert


From: John W. Eaton
Subject: [Changeset] Compatibility fix for assert
Date: Mon, 12 May 2008 22:26:22 -0500

On  9-May-2008, David Bateman wrote:

| Matlab's assert function doesn't have the same syntax as Octave. There
| is an overlap in that assert(cond) is the same. However, matlab doesn't
| accept the expected value or tolerance arguments but instead accepts an
| error message, msgid and additional arguments to print.
| 
| If we assume that if the first argument is logical and the second a
| string, then we have a matlab compatible use of assert it is easy to add
| this feature, and the attached changeset does this.

I applied it.

| We might even
| enlarge the case to have isnumeric(cond) and second arg is a string be
| accepted, but in that case assert(3,"dog") will change its behavior.

I don't have a strong opinion about this, but now that Matlab has this
function, I suppose we need to be careful about adding additional
extensions to their behavior that might cause compatibility problems
in the future.

Thanks,

jwe


reply via email to

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