You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? to g
> localmake "foo "bar
> local "foo
> show :foo
> end
g defined
? g
foo has no value in g
[show :foo]
I can see how this happens. LOCAL creates a placeholder in the variable stack and assigns the value {nothing}. But if a value already exists should it be clobbered?
The text was updated successfully, but these errors were encountered:
"If a variable already exists" is the wrong condition, though, since variables are inherited from any outer scope. So, if you were to change this, it'd have to be "if a variable of the same name has already been created in this procedure call..."
The current behavior has been the case right from the beginning of ucblogo, so if it's a bug it's a longstanding one. The manual is silent on the question. So I think it's okay to keep the current behavior, but I agree that the suggested change would be an improvement, just in case the LOCAL is inside a FOR loop or some such thing.
Is this a bug?
I can see how this happens.
LOCAL
creates a placeholder in the variable stack and assigns the value{nothing}
. But if a value already exists should it be clobbered?The text was updated successfully, but these errors were encountered: