Mercurial > octave-nkf
comparison libinterp/octave-value/ov-fcn-handle.cc @ 18537:f958e8cd6348
maint: Periodic merge of gui-release to default.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 01 Mar 2014 22:11:32 -0800 |
parents | b0aba84cf80f ea0d4dea1a17 |
children | 6ca096827123 |
comparison
equal
deleted
inserted
replaced
18528:9c8321ea6f58 | 18537:f958e8cd6348 |
---|---|
1659 %! endfor | 1659 %! endfor |
1660 */ | 1660 */ |
1661 | 1661 |
1662 DEFUN (functions, args, , | 1662 DEFUN (functions, args, , |
1663 "-*- texinfo -*-\n\ | 1663 "-*- texinfo -*-\n\ |
1664 @deftypefn {Built-in Function} {} functions (@var{fcn_handle})\n\ | 1664 @deftypefn {Built-in Function} {@var{s} =} functions (@var{fcn_handle})\n\ |
1665 Return a struct containing information about the function handle\n\ | 1665 Return a structure containing information about the function handle\n\ |
1666 @var{fcn_handle}.\n\ | 1666 @var{fcn_handle}.\n\ |
1667 \n\ | |
1668 The structure @var{s} always contains these 3 fields:\n\ | |
1669 \n\ | |
1670 @table @asis\n\ | |
1671 @item function\n\ | |
1672 The function name. For an anonymous function (no name) this will be the\n\ | |
1673 actual function definition.\n\ | |
1674 \n\ | |
1675 @item type\n\ | |
1676 Type of the function.\n\ | |
1677 \n\ | |
1678 @table @asis\n\ | |
1679 @item anonymous\n\ | |
1680 The function is anonymous.\n\ | |
1681 \n\ | |
1682 @item private\n\ | |
1683 The function is private.\n\ | |
1684 \n\ | |
1685 @item overloaded\n\ | |
1686 The function overloads an existing function.\n\ | |
1687 \n\ | |
1688 @item simple\n\ | |
1689 The function is a built-in or m-file function.\n\ | |
1690 \n\ | |
1691 @item subfunction\n\ | |
1692 The function is a subfunction within an m-file.\n\ | |
1693 @end table\n\ | |
1694 \n\ | |
1695 @item file\n\ | |
1696 The m-file that will be called to perform the function. This field is empty\n\ | |
1697 for anonymous and built-in functions.\n\ | |
1698 @end table\n\ | |
1699 \n\ | |
1700 In addition, some function types may return more information in additional\n\ | |
1701 fields.\n\ | |
1702 \n\ | |
1703 @strong{Warning:} @code{functions} is provided for debugging purposes only.\n\ | |
1704 It's behavior may change in the future and programs should not depend on a\n\ | |
1705 particular output.\n\ | |
1706 \n\ | |
1667 @end deftypefn") | 1707 @end deftypefn") |
1668 { | 1708 { |
1669 octave_value retval; | 1709 octave_value retval; |
1670 | 1710 |
1671 if (args.length () == 1) | 1711 if (args.length () == 1) |
1760 DEFUN (func2str, args, , | 1800 DEFUN (func2str, args, , |
1761 "-*- texinfo -*-\n\ | 1801 "-*- texinfo -*-\n\ |
1762 @deftypefn {Built-in Function} {} func2str (@var{fcn_handle})\n\ | 1802 @deftypefn {Built-in Function} {} func2str (@var{fcn_handle})\n\ |
1763 Return a string containing the name of the function referenced by\n\ | 1803 Return a string containing the name of the function referenced by\n\ |
1764 the function handle @var{fcn_handle}.\n\ | 1804 the function handle @var{fcn_handle}.\n\ |
1805 @seealso{str2func, functions}\n\ | |
1765 @end deftypefn") | 1806 @end deftypefn") |
1766 { | 1807 { |
1767 octave_value retval; | 1808 octave_value retval; |
1768 | 1809 |
1769 if (args.length () == 1) | 1810 if (args.length () == 1) |
1799 @deftypefn {Built-in Function} {} str2func (@var{fcn_name})\n\ | 1840 @deftypefn {Built-in Function} {} str2func (@var{fcn_name})\n\ |
1800 @deftypefnx {Built-in Function} {} str2func (@var{fcn_name}, \"global\")\n\ | 1841 @deftypefnx {Built-in Function} {} str2func (@var{fcn_name}, \"global\")\n\ |
1801 Return a function handle constructed from the string @var{fcn_name}.\n\ | 1842 Return a function handle constructed from the string @var{fcn_name}.\n\ |
1802 If the optional @qcode{\"global\"} argument is passed, locally visible\n\ | 1843 If the optional @qcode{\"global\"} argument is passed, locally visible\n\ |
1803 functions are ignored in the lookup.\n\ | 1844 functions are ignored in the lookup.\n\ |
1845 @seealso{func2str, inline}\n\ | |
1804 @end deftypefn") | 1846 @end deftypefn") |
1805 { | 1847 { |
1806 octave_value retval; | 1848 octave_value retval; |
1807 int nargin = args.length (); | 1849 int nargin = args.length (); |
1808 | 1850 |
1839 | 1881 |
1840 DEFUN (is_function_handle, args, , | 1882 DEFUN (is_function_handle, args, , |
1841 "-*- texinfo -*-\n\ | 1883 "-*- texinfo -*-\n\ |
1842 @deftypefn {Built-in Function} {} is_function_handle (@var{x})\n\ | 1884 @deftypefn {Built-in Function} {} is_function_handle (@var{x})\n\ |
1843 Return true if @var{x} is a function handle.\n\ | 1885 Return true if @var{x} is a function handle.\n\ |
1844 @seealso{isa, typeinfo, class}\n\ | 1886 @seealso{isa, typeinfo, class, functions}\n\ |
1845 @end deftypefn") | 1887 @end deftypefn") |
1846 { | 1888 { |
1847 octave_value retval; | 1889 octave_value retval; |
1848 | 1890 |
1849 int nargin = args.length (); | 1891 int nargin = args.length (); |