zsh-users
 help / color / mirror / code / Atom feed
* unset private variables
@ 2023-09-03 12:06 jsks
  2023-09-03 18:02 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: jsks @ 2023-09-03 12:06 UTC (permalink / raw)
  To: zsh-users; +Cc: Joshua Krusell

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Hi,

Apologizes if I missed something in the documentation, but I'm running into
the following problem and wondering what is the intended behaviour.

Unsetting a variable declared with param/private and then modifying it
returns the error "can't change parameter attribute". Declaring using
`local` works, however, and preserves the `local-scalar` attribute.

Example code, run on zsh-5.9:

zmodload zsh/param/private
function foo() {
    private x=1
    unset x
    x=2
}
foo

/Joshua

[-- Attachment #2: Type: text/html, Size: 700 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-03 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 12:06 unset private variables jsks
2023-09-03 18:02 ` Bart Schaefer
2023-09-03 18:12   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).