comparison src/ov-fcn-handle.cc @ 4649:f7ce581b27fb

[project @ 2003-11-23 21:46:44 by jwe]
author jwe
date Sun, 23 Nov 2003 21:46:44 +0000
parents d44675070f1a
children a9b22513b7a6
comparison
equal deleted inserted replaced
4648:dca0236ad77c 4649:f7ce581b27fb
52 52
53 void 53 void
54 octave_fcn_handle::print_raw (std::ostream& os, bool pr_as_read_syntax) const 54 octave_fcn_handle::print_raw (std::ostream& os, bool pr_as_read_syntax) const
55 { 55 {
56 indent (os); 56 indent (os);
57 os << "@" << name (); 57 os << name ();
58 } 58 }
59 59
60 octave_value 60 octave_value
61 make_fcn_handle (const std::string& nm) 61 make_fcn_handle (const std::string& nm)
62 { 62 {
95 95
96 if (fcn) 96 if (fcn)
97 { 97 {
98 Octave_map m; 98 Octave_map m;
99 99
100 m ["function"](0) = fh->name (); 100 std::string fh_nm = fh->name ();
101
102 m ["function"](0) = fh_nm.substr (1);
101 103
102 if (fcn->is_nested_function ()) 104 if (fcn->is_nested_function ())
103 m ["type"](0) = "subfunction"; 105 m ["type"](0) = "subfunction";
104 else 106 else
105 m ["type"](0) = "simple"; 107 m ["type"](0) = "simple";
137 if (args.length () == 1) 139 if (args.length () == 1)
138 { 140 {
139 octave_fcn_handle *fh = args(0).fcn_handle_value (); 141 octave_fcn_handle *fh = args(0).fcn_handle_value ();
140 142
141 if (! error_state && fh) 143 if (! error_state && fh)
142 retval = fh->name (); 144 {
145 std::string fh_nm = fh->name ();
146 retval = fh_nm.substr (1);
147 }
143 else 148 else
144 error ("func2str: expecting valid function handle as first argument"); 149 error ("func2str: expecting valid function handle as first argument");
145 } 150 }
146 else 151 else
147 print_usage ("func2str"); 152 print_usage ("func2str");