comparison src/ov-builtin.cc @ 5864:e884ab4f29ee

[project @ 2006-06-22 00:57:27 by jwe]
author jwe
date Thu, 22 Jun 2006 00:57:28 +0000
parents ace8d8d26933
children 93c65f2a5668
comparison
equal deleted inserted replaced
5863:4c16f3104aa5 5864:e884ab4f29ee
35 DEFINE_OCTAVE_ALLOCATOR (octave_builtin); 35 DEFINE_OCTAVE_ALLOCATOR (octave_builtin);
36 36
37 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_builtin, 37 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_builtin,
38 "built-in function", 38 "built-in function",
39 "built-in function"); 39 "built-in function");
40
41 // Are any of the arguments `:'?
42
43 static bool
44 any_arg_is_magic_colon (const octave_value_list& args)
45 {
46 int nargin = args.length ();
47
48 for (int i = 0; i < nargin; i++)
49 if (args(i).is_magic_colon ())
50 return true;
51
52 return false;
53 }
54 40
55 octave_value_list 41 octave_value_list
56 octave_builtin::subsref (const std::string& type, 42 octave_builtin::subsref (const std::string& type,
57 const std::list<octave_value_list>& idx, 43 const std::list<octave_value_list>& idx,
58 int nargout) 44 int nargout)
103 octave_value_list retval; 89 octave_value_list retval;
104 90
105 if (error_state) 91 if (error_state)
106 return retval; 92 return retval;
107 93
108 if (any_arg_is_magic_colon (args)) 94 if (args.has_magic_colon ())
109 ::error ("invalid use of colon in function argument list"); 95 ::error ("invalid use of colon in function argument list");
110 else 96 else
111 { 97 {
112 unwind_protect::begin_frame ("builtin_func_eval"); 98 unwind_protect::begin_frame ("builtin_func_eval");
113 99