zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: How to have function local variable but must behave just a simple one
Date: Sat, 26 Aug 2023 14:10:58 -0700	[thread overview]
Message-ID: <eeeb1539-377e-ef3f-e96a-435dfd8e422b@eastlink.ca> (raw)
In-Reply-To: <CAN=4vMoUqVR3p=fQR_anCLiywmmU-vnw4SupZTEzun-X1SxWoA@mail.gmail.com>


On 2023-08-26 13:58, Roman Perepelitsa wrote:
>
> Indeed, given that in zsh there are no function-scoped parameters that
> outlive an invocation of the function, Budi will have to use a global
> parameter and take necessary precautions to ensure the name of the
> parameter does not clash with other globals.
>
> Roman.

I'm puzzled as to what the problem really is from a practical point  of 
view.  Easy enough to create a 'safe' name, no?  I suppose for  tidiness 
sake one might not want variables specific to only one function to be 
global, but there's zillions of that sort of variable already so one 
lives with that rather easily. And this is universal across all shells, 
yes?  I have a set of local variables that I need to survive reboot, so 
I write 'em to a file which is reread on startup.  That would work for 
Budi, but again it seems like there's not really a big problem.  (Mind, 
I have a long history of seeing problems where there is no problem ;-)





  reply	other threads:[~2023-08-26 21:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26  7:25 Budi
2023-08-26  7:34 ` Roman Perepelitsa
2023-08-26 20:26   ` Bart Schaefer
2023-08-26 20:38     ` Ray Andrews
2023-08-26 20:58       ` Roman Perepelitsa
2023-08-26 21:10         ` Ray Andrews [this message]
2023-08-26 21:13           ` Roman Perepelitsa
2023-08-27  0:50           ` Budi

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=eeeb1539-377e-ef3f-e96a-435dfd8e422b@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@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).