From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23150 invoked by alias); 22 Jul 2015 13:55:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20336 Received: (qmail 20835 invoked from network); 22 Jul 2015 13:55:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=ji/9xj5BO6MK64UKNot/KTM1fYAfba2e+z6IQiNGfUE=; b=fcUl6/aMzY5P0fJZpqzfT2g0er3H9K/kjO0h8gOmeFLRf/gyCR4DRSUDqyZA1/jIqs F4CBL1NVlKII3YRmdJVZ2ht57tqlNG+BWTMWoBrw+IsdNXMue4kkxQDkEiO08Vnw28B2 pODbutOHcAXP9Vs8/dlkonfwkChQ1Jtq+PxwE3c/bIomN5akt6jDlexbDLWgGcVPv9NC FF/whqqafit84bzLpWIXUXjXeshsdG9CUxU0taM9gb0rWvrCoVzYtLXjUxQAggEyGq2w unZ41qqn1RcTEqB0s3hv5cnPDDQDwZSjM8K11evOhhPrUbzeka32wPvr5tH7ELJNqkO3 XTcA== X-Received: by 10.152.87.205 with SMTP id ba13mr2452148lab.37.1437573325881; Wed, 22 Jul 2015 06:55:25 -0700 (PDT) Date: Wed, 22 Jul 2015 15:55:19 +0200 From: Joshua Krusell To: zsh-users@zsh.org Subject: Re: sound policy on global variables for "distributed" DWIM function Message-ID: <20150722135519.GA11359@Qliphoth.local> Mail-Followup-To: zsh-users@zsh.org References: <87fv4hm3ia.fsf@nl106-137-147.student.uu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fv4hm3ia.fsf@nl106-137-147.student.uu.se> User-Agent: Mutt/1.5.23 (2014-03-12) 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