zsh-users
 help / color / mirror / code / Atom feed
From: Joshua Krusell <js.shirin@gmail.com>
To: zsh-users@zsh.org
Subject: Re: sound policy on global variables for "distributed" DWIM function
Date: Wed, 22 Jul 2015 15:55:19 +0200	[thread overview]
Message-ID: <20150722135519.GA11359@Qliphoth.local> (raw)
In-Reply-To: <87fv4hm3ia.fsf@nl106-137-147.student.uu.se>

Greetings from a fellow UU-er!

On 22/07/15 at 02:37, Emanuel Berg wrote:
> So, do I put that data a global variable (and what is
> the best way to do that?), or do I have a function
> return that value and thus have two invocations but
> only one data item, or do I do something else?

Define a variable in your script, export an environmental var if it's
being sourced (beware name collisions, use a prefix), or even pass it as
an argument; it's up to you.

/jsks


  reply	other threads:[~2015-07-22 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22  0:37 Emanuel Berg
2015-07-22 13:55 ` Joshua Krusell [this message]
2015-07-22 23:25   ` Emanuel Berg
2015-07-23  1:41     ` Bart Schaefer

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=20150722135519.GA11359@Qliphoth.local \
    --to=js.shirin@gmail.com \
    --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).