# HG changeset patch # User John W. Eaton # Date 1347935743 14400 # Node ID 66e17621f99a132b0c3c1d3fce1a8d8c52723742 # Parent 2e5ba861898f386c3aef44a52e83a99a805fcd93 * variables.h, variables.cc (clear_current_scope): New function. diff --git a/libinterp/interpfcn/variables.cc b/libinterp/interpfcn/variables.cc --- a/libinterp/interpfcn/variables.cc +++ b/libinterp/interpfcn/variables.cc @@ -2340,8 +2340,8 @@ { if (argc == 1) { - do_clear_globals (argv, argc, 1); - do_clear_variables (argv, argc, 1); + do_clear_globals (argv, argc, true); + do_clear_variables (argv, argc, true); } else { @@ -2460,6 +2460,12 @@ return retval; } +void +clear_current_scope (void) +{ + Fclear (); +} + DEFUN (whos_line_format, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} whos_line_format ()\n\ diff --git a/libinterp/interpfcn/variables.h b/libinterp/interpfcn/variables.h --- a/libinterp/interpfcn/variables.h +++ b/libinterp/interpfcn/variables.h @@ -148,4 +148,7 @@ extern OCTINTERP_API void maybe_missing_function_hook (const std::string& name); +// Equivalent to Fclear without any arguments. +extern OCTINTERP_API void clear_current_scope (void); + #endif