zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] functions can't create global readonly variables
Date: Sun, 3 Jan 2016 19:00:31 +0000	[thread overview]
Message-ID: <20160103190031.24249cf5@ntlworld.com> (raw)
In-Reply-To: <160102123639.ZM16270@torch.brasslantern.com>

By the way it seems that, in bash at least, "readonly" breaks
encapsulation:

$ readonly foo=empty
$ fn() { local foo=bar; echo $foo; }
$ fn
bash: local: foo: readonly variable
empty

The only use I can see of this is for exported variables, where you
might want to ensure a specific value was always exported to an external
programme.

pws


  reply	other threads:[~2016-01-03 19:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02  3:27 Martijn Dekker
2016-01-02  4:27 ` Bart Schaefer
2016-01-02 18:18   ` Peter Stephenson
2016-01-02 20:36     ` Bart Schaefer
2016-01-03 19:00       ` Peter Stephenson [this message]
2016-01-03 19:21         ` Bart Schaefer
2016-01-02 19:39   ` Martijn Dekker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160103190031.24249cf5@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).