[Changeset] Compatibility fix for assert

David Bateman adb014 at gmail.com
Fri May 9 07:30:49 CDT 2008


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. 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.

Regards
David
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch8065
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080509/c8853c81/attachment.ksh 


More information about the Octave-maintainers mailing list