[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62697] What wizardry is this
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #62697] What wizardry is this |
Date: |
Sat, 2 Jul 2022 15:57:56 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62697>
Summary: What wizardry is this
Project: GNU Octave
Submitter: None
Submitted: Sat 02 Jul 2022 07:57:54 PM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 7.1.0
Discussion Lock: Any
Operating System: Microsoft Windows
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 02 Jul 2022 07:57:54 PM UTC By: Anonymous
for i = 1:5
i
clear
i
end
i = 1
ans = 0 + 1i
i = 2
ans = 0 + 1i
i = 3
ans = 0 + 1i
i = 4
ans = 0 + 1i
i = 5
ans = 0 + 1i
The loop executes 5 times with no error.
What wizardry is this? How did i get its loop value back after being cleared?
Refactor the variable name and it causes an error.
for a = 1:5
a
clear
a
end
gives
a = 1
error: 'a' undefined near line 1, column 24
Now the loop executes only once and ends with an error.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62697>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #62697] What wizardry is this,
anonymous <=