view test/colon-op/@legacy_colon_op/colon.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 source

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