Mercurial > octave
diff test/colon-op/colon_op.m @ 28519:d4563c5d4060
handle all dispatching for colon operator in do_colon_op function
* ov.cc (do_colon_op): Handle all dispatching here, but using lookup
based on argument vector passed to feval instead of determining
dispatch type separately.
* pt-colon.cc (tree_colon_expression::evaluate): Simply evaluate
arguments and pass them to do_colon_op.
* test/colon-op: New test directory.
* test/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 29 Jun 2020 23:45:19 -0400 |
parents | |
children | b73a54c31152 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/colon-op/colon_op.m Mon Jun 29 23:45:19 2020 -0400 @@ -0,0 +1,11 @@ +classdef colon_op + methods + function r = colon (a, b, c) + if (nargin == 2) + r = sprintf ("%s:%s", class (a), class (b)); + else + r = sprintf ("%s:%s:%s", class (a), class (b), class (c)); + end + end + end +end