Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16261

Re: Local variable names clash with global read-only variable names.

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Local variable names clash with global read-only variable names.
Date Fri, 1 May 2020 07:37:00 -0400
Lines 25
Approved bug-bash@gnu.org
Message-ID <mailman.1756.1588333100.3066.bug-bash@gnu.org> (permalink)
References <be8dd110-c269-be88-b14c-8359e4c547f5@case.edu> <87wo5wgys6.fsf@hobgoblin.ariadne.com> <20200501113700.GC17864@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1588333101 24071 209.51.188.17 (1 May 2020 11:38:21 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
Mail-Followup-To bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <87wo5wgys6.fsf@hobgoblin.ariadne.com>
User-Agent Mutt/1.10.1 (2018-07-13)
Received-SPF none client-ip=139.137.100.1; envelope-from=wooledg@eeg.ccf.org; helo=mail.eeg.ccf.org
X-detected-operating-system by eggs.gnu.org: First seen = 2020/05/01 07:37:01
X-ACL-Warn Detected OS = Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20200501113700.GC17864@eeg.ccf.org>
X-Mailman-Original-References <be8dd110-c269-be88-b14c-8359e4c547f5@case.edu> <87wo5wgys6.fsf@hobgoblin.ariadne.com>
Xref csiph.com gnu.bash.bug:16261

Show key headers only | View raw


On Thu, Apr 30, 2020 at 10:43:53PM -0400, Dale R. Worley wrote:
> This is a common issue in language design.  The Perl language originally
> only had "local" declarations that behaved the same way as bash local
> declarations.  But the above behavior got to be so much of a problem for
> large programs that Perl added a separate lexically-scoped local
> declaration.

Perl is a programming language.  It makes sense that perl would evolve
in a way that makes it more useful for writing programs.

Bash, on the other hand, is first and foremost a *shell*.  It's designed
to act as an interface for executing commands, either interactively, or
in a script.  Its use as a programming language is a distant second goal.

In the context of a shell, variables have *power* and *meaning*.  If a
variable is declared readonly, it's because someone wants it to remain
unchanged.  Consider what happens when someone changes PATH or HOME.

Readonly variables become immutable, because changing them would break
something.  Someone decided that, and *made* the variable readonly, and
they had some reason to do that.  You're not allowed to circumvent
that restriction.

It has nothing to do with language design.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Local variable names clash with global read-only variable names. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-01 07:37 -0400

csiph-web