changeset 9421:86eb5ff921d0

pt-assign.cc (maybe_warn_former_built_in_variable): improve message
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jul 2009 14:06:53 -0400
parents 434ae96dc10f
children d8d410b08228
files src/ChangeLog src/pt-assign.cc
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jul 08 13:49:21 2009 -0400
+++ b/src/ChangeLog	Wed Jul 08 14:06:53 2009 -0400
@@ -1,3 +1,7 @@
+2009-07-08  John W. Eaton  <jwe@octave.org>
+
+	* pt-assign.cc (maybe_warn_former_built_in_variable): Improve message.
+
 2009-07-04  Jaroslav Hajek  <highegg@gmail.com>
 
 	* pt-eval.cc (do_unwind_protect_cleanup_code): Add missing
--- a/src/pt-assign.cc	Wed Jul 08 13:49:21 2009 -0400
+++ b/src/pt-assign.cc	Wed Jul 08 14:06:53 2009 -0400
@@ -153,9 +153,13 @@
     }
 
   if (vars.find (nm) != vars.end ())
-    warning_with_id ("Octave:built-in-variable-assignment",
-		     "%s is no longer a built-in variable; please read the NEWS file or type `news' for details",
-		     nm.c_str ());
+    {
+      const char *nm_c_str = nm.c_str ();
+
+      warning_with_id ("Octave:built-in-variable-assignment",
+		       "%s is now a function instead of a built-in variable.  By assigning to %s, you have created a variable that hides the function %s.  To remove the variable and restore the function, type \"clear %s\"",
+		       nm_c_str, nm_c_str, nm_c_str, nm_c_str);
+    }
 }
 
 tree_simple_assignment::tree_simple_assignment