octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implementation of clear()


From: Thomas Weber
Subject: Implementation of clear()
Date: Tue, 25 Dec 2007 20:53:29 +0100

Hi, 

the current implementation of clear() tries to mimic the M* approach for
a few arguments (namely all, functions, global, variables).

I think it makes sense to add "exclusive" to this list. Consider the
following (3.0.0):

==========================================
octave3.0:25> a = 1; global b = 2;
octave3.0:26> clear -exclusive b
octave3.0:27> b,a
b =  2
error: `a' undefined near line 27 column 3
==========================================
As expected, a is removed and b survives.


==========================================
octave3.0:27> a = 1; global b = 2;
octave3.0:28> clear exclusive b
octave3.0:29> a,b
a =  1
error: `b' undefined near line 29 column 3
==========================================
Now, "b" is removed and "a" survives, which I find highly surprising.

No patch, as I want to hear some opinions first.

        Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]