From octave-maintainers-request at bevo dot che dot wisc dot edu Sun Jan 12 01:12:05 2003 Subject: overloaded functions From: Paul Kienzle To: octave-dev at lists dot sourceforge dot net Cc: octave-maintainers at bevo dot che dot wisc dot edu, David Bateman Date: Sun, 12 Jan 2003 02:08:39 -0500 I've added dispatch.cc to octave-forge/main/miscellaneous. This adds the ability to overload functions in octave. E.g., mark_as_command dispatch dispatch sin string g function g,'g',end sin('x') # ==> g sin(3) # ==> 0.14112 dispatch min string g min([1 2 3]) # ==> 1 min('x') # ==> g dispatch reshape string g reshape(1:6,2,3) # ==> [1 3 5; 2 4 6 ] reshape('x',2,3) # ==> g help sin # ==> sin is a builtin function - Mapping Function: sin (X) Compute the sin of each element of X. Overloaded function string:g If you are using octave 2.1.40 compile it with mkoctfile -DOCTAVE2140 dispatch.cc, otherwise use octave 2.1.43. Now we need PKG_ADD to contain the appropriate dispatch functions for octave forge, such as "dispatch find sparse spfind". Paul Kienzle pkienzle at users dot sf dot net