[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compatibility considerations of "clear"
From: |
Philipp Kutin |
Subject: |
Re: Compatibility considerations of "clear" |
Date: |
Thu, 15 Aug 2013 17:37:07 +0200 |
On Wed, Aug 14, 2013 at 9:25 PM, John W. Eaton <address@hidden> wrote:
> I think the attached patch will fix the behavior for clear without any
> arguments.
No, it doesn't. The values of global variables are still cleared when
only the names should.
> Is the current Octave behavior for functions also wrong? Given the function
> (...)
> what do the following commands do?
> (...)
Here's the result of a slightly modified foo.m (attached) on R2013a.
Indented lines are echoed commands, the others are input/output.
>> dofoo
foo % Call the function
X IS NOT INITIALIZED
foo % Call the function
CALLED FOO
foo = 1; % Assign to a variable
foo % Refer to the variable
foo = 1
clear foo % Clear the variable
foo % Call the function
CALLED FOO
clear foo % Clear the function
foo % Call the function
X IS NOT INITIALIZED
By the way, what I said may not have been consistent. I'll try to
clarify another time.
--Philipp
foo.m
Description: Binary data
Re: Compatibility considerations of "clear", Julien Bect, 2013/08/15
Re: Compatibility considerations of "clear", Jordi GutiƩrrez Hermoso, 2013/08/14