diff scripts/legacy/@inline/char.m @ 28427:7a8c69c4eb55 stable

convert obsolete octave_fcn_inline object to @inline class Use a legacy @class object to provide inline function objects instead of using a built-in class derived from the octave_function_handle class. * scripts/legacy/@inline: New directory containing the following files: argnames.m, char.m, feval.m, formula.m, inline.m, subsref.m, vectorize.m. * scripts/legacy/@inline/module.mk: New file. * scripts/legacy/module.mk, scripts/module.mk: Update. * test/inline-fcn.tst: New tests. * test/module.mk: Update. * ov-fcn-inline.h, ov-fcn-inline.cc: Delete. Remove all uses. * libinterp/octave-value/module.mk: Update. * external.txi, func.txi, octave.texi, plot.txi, quad.txi: Eliminate discusion of inline function objects. * fplot.m, __ezplot__.m: Use isa to identify inline objects instead of instead of checking typeinfo. * ov-fcn-handle.cc, ov-typeinfo.cc: Fix tests. * ov-base.h, ov-base.cc (octave_base_value::fcn_inline_value): Delete. * ov.h, ov.cc (octave_value::fcn_inline_value): Delete. (octave_value::xfcn_inline_value): Delete value extractor. * ov-class.cc, ov-class.h (octave_inline, octave_inline_fcn): New classes that allow us to preserve the is_inline_function and function_value methods that were previously available in the octave_fcn_inline class. (F__inline_ctor__): New function for final construction of inline objects. * ls-hdf5.cc, ls-mat5.cc, ls-oct-binary.cc, ls-oct-text.cc: Handle loading of inline function objects from old files as special cases. New inline function objects will be saved and loaded as ordinary @class objects.
author John W. Eaton <jwe@octave.org>
date Mon, 23 Mar 2020 15:29:49 -0400
parents
children 0d56bfb63b90
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/legacy/@inline/char.m	Mon Mar 23 15:29:49 2020 -0400
@@ -0,0 +1,18 @@
+## -*- texinfo -*-
+## @deftypefn {} {} char (@var{fun})
+## Return a character string representing the inline function @var{fun}.
+##
+## Note that @code{char (@var{fun})} is equivalent to
+## @code{formula (@var{fun})}.
+## @seealso{char, argnames, inline, vectorize}
+## @end deftypefn
+
+function expr = char (obj)
+
+  if (nargin != 1)
+    print_usage ();
+  endif
+
+  expr = obj.expr;
+
+endfunction