Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Documentation on (A) Create array parameter
- X-seq: zsh-workers 40617
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Documentation on (A) Create array parameter
- Date: Wed, 22 Feb 2017 11:58:02 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=resent-from:resent-message-id:resent-date:resent-to:from:message-id :date:in-reply-to:comments:references:to:subject:mime-version; bh=gxyue0p1nVjX9XQMyNBwxck27b9Dupn9UH3H//XXwy0=; b=YyPjYXvAJfZ8CYmTHUq0vqXG3AwUCyrUzKcq1HXUe76CTPIaSQO0ESW6+7US3a2PAJ cx8jf/+ZzecaCFEQR+GPMfuPNyKZB/fNxmCGBofo6ophPCELQPAl8vY4FmtTFFh+JEHc lt9nUzkRpYIBXdeGZcpwHD4JKDRZcdt0qPEehYS8nfdhKWEFvjyFZsxSPWh1Ywku8CYu L1i/PX48xBRW/wEtvUqQyRNaj02K2T6jXNpcIme7KKKSQvAW8dSMZ0H2dh1WAO07KyCL Z5VpTzNhVRJJUrcJM1bFKGn4obaxTjiB/GB9C+Q1uW4I4LcDTJG8vUvZcAA7N+zQIeMr i0aA==
- In-reply-to: <1487763613.2941773.889107120.2750751A@webmail.messagingengine.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1487763613.2941773.889107120.2750751A@webmail.messagingengine.com>
On Feb 22, 3:40am, Sebastian Gniazdowski wrote:
}
} (A) completion and documentation suggest straight creation:
There's no such thing as "straight creation" of a parameter; the whole
shell model depends on dynamic scoping. Assignments *always* apply to
any parameter that is already in scope, the only way to change that is
by declaring the parameter with typeset/local/etc.
Furthermore, this specific instance is with reference to the earlier
documentation for ${NAME=WORD} et al. which says:
In the first form, if NAME is unset then set it to WORD; in the
second form, if NAME is unset or null then set it to WORD; and in
the third form, unconditionally set NAME to WORD.
There'd be no point in calling out the difference between set, unset,
and set but null parameters if they were being "created" in the way you
have interpreted it here.
So if the use of the word "create" here is actually confusing, it's
that word that should be changed; clarifying semantics of dynamic
scoping is something for a much larger context. Would it have led you
astray if instead the paragraph said "Assign as an array parameter ..." ?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author