49 error (
"binary operator '%s': invalid number of output arguments",
61 "Matlab-style short-circuit operation performed for operator %s",
193 error (
"binary operator '%s': invalid number of output arguments",
262 std::string retval =
"<unknown>";
295 DEFUN (do_braindead_shortcircuit_evaluation, args, nargout,
297 @deftypefn {Built-in Function} {@var{val} =} do_braindead_shortcircuit_evaluation ()\n\
298 @deftypefnx {Built-in Function} {@var{old_val} =} do_braindead_shortcircuit_evaluation (@var{new_val})\n\
299 @deftypefnx {Built-in Function} {} do_braindead_shortcircuit_evaluation (@var{new_val}, \"local\")\n\
300 Query or set the internal variable that controls whether Octave will\n\
301 do short-circuit evaluation of @samp{|} and @samp{&} operators inside the\n\
302 conditions of if or while statements.\n\
304 This feature is only provided for compatibility with @sc{matlab} and should\n\
305 not be used unless you are porting old code that relies on this feature.\n\
307 To obtain short-circuit behavior for logical expressions in new programs,\n\
308 you should always use the @samp{&&} and @samp{||} operators.\n\
310 When called from inside a function with the @qcode{\"local\"} option, the\n\
311 variable is changed locally for the function and any subroutines it calls.\n\
312 The original variable value is restored when exiting the function.\n\
315 static bool warned =
false;
320 "do_braindead_shortcircuit_evaluation is obsolete and will be removed from a future version of Octave");
void warning_with_id(const char *id, const char *fmt,...)
octave_value::binary_op etype
octave_idx_type rows(void) const
static std::string binary_op_as_string(binary_op)
std::string oper(void) const
bool is_defined(void) const
void matlab_style_short_circuit_warning(const char *op)
#define DEFUN(name, args_name, nargout_name, doc)
virtual tree_expression * dup(symbol_table::scope_id, symbol_table::context_id context) const =0
void error(const char *fmt,...)
#define SET_INTERNAL_VARIABLE(NM)
octave_value_list rvalue(int nargout)
virtual void copy_base(const tree_expression &e)
octave_value rvalue1(int nargout=1)
#define END_PROFILER_BLOCK
octave_value rvalue1(int nargout=1)
octave_value_list rvalue(int nargout)
virtual void visit_binary_expression(tree_binary_expression &)=0
std::string oper(void) const
octave_idx_type columns(void) const
tree_expression * dup(symbol_table::scope_id scope, symbol_table::context_id context) const
bool eligible_for_braindead_shortcircuit
static llvm::LLVMContext & context
tree_expression * dup(symbol_table::scope_id scope, symbol_table::context_id context) const
bool braindead_shortcircuit_warning_issued
tree_binary_expression(int l=-1, int c=-1, octave_value::binary_op t=octave_value::unknown_binary_op)
virtual int line(void) const
virtual octave_value rvalue1(int nargout=1)
static bool Vdo_braindead_shortcircuit_evaluation
void accept(tree_walker &tw)
virtual int column(void) const
tree_boolean_expression(int l=-1, int c=-1, type t=unknown)
#define BEGIN_PROFILER_BLOCK(classname)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
octave_value do_binary_op(octave_value::binary_op op, const octave_value &v1, const octave_value &v2)