Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Interpret Parameter Value at Time of Function Definition
- X-seq: zsh-users 22863
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: Interpret Parameter Value at Time of Function Definition
- Date: Tue, 05 Sep 2017 16:17:07 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yZ2uqS +XYLK3wjug4OXwVEr+qo6iizBNwU9AZQAueE8=; b=onh1t/qXpxyFDhu+e9h/My Q536li00w4e1vZW6WJI58suCTf2MEuL3rqBKm9kmRTt2bAeZXgDnhJBvfmFCJTph Q0zyZDa6W4oSAh/N2mSE0uwetimTPywmTkZNFoB5U0tNUG3QdIlHApPQnQcLSTup IsqG6dGQ2J76Ag16biah5ZaVe0BNuUYcjPGwhENSe00NOlDXDPvhiaNf+qd6oJy6 lZWocFR21w5A8carHfgp6trywY/JmYPMPrW+Q+/v+1FiVRUYgRe9FmBjgRufYiY3 01oKOH7aDm1UB9a+QqEQHl+OsYIIOxvUjep4HGjutJZHkLNAwX8hs/nKBoB1mK3A ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yZ2uqS +XYLK3wjug4OXwVEr+qo6iizBNwU9AZQAueE8=; b=YVsYlbdCG11ri1R6/OjkRi pfciaPsJz2X7MAQTlaIOtxevdwmwLxJuHJPEaqILfA/CwSHJ/sytf4Vk6G+/oXc2 M2apZBquM5q/i3lM1K437OxrA7PoE5kyv6AoAMylwTUiBwceTYiShK246Xyh6EXB XoRxujULkXCIQAxLkzmKn8lHKFP9AupD40sUYxxqys2oU6UbuuORo9MOQBpzAco7 pRtqoVnPsz+0JYp5LHIIzqNe3yNXyF7PfhWSA9I/oCx4VLmc55ewuDeOw7Bebabb T56y28OSIBGbY7qhJ93KoJeuWaOSYPAp4a5mBua4QrZVNb/jfSrFkRNNOXspDKBA ==
- In-reply-to: <CACeGjnVYHHZHrGcZzMeaEq-feeuG9XShK5AM9XzAs8t+W6xCZA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CACeGjnVYHHZHrGcZzMeaEq-feeuG9XShK5AM9XzAs8t+W6xCZA@mail.gmail.com>
Vin Shelton wrote on Tue, 05 Sep 2017 09:47 -0400:
> $ aaa=bbb
> $ function t {
> print aaa = \"$aaa\"
> }
>
> I would like to interpret $aaa at read time, so that:
>
> aaa=ccc t
>
> would print:
>
> aaa = "bbb"
Declare aaa local inside the function:
t() {
local aaa=bbb
typeset -p aaa
}
aaa=ccc t
... but then, if t() changes $aaa the changes won't be visible outside t().
Messages sorted by:
Reverse Date,
Date,
Thread,
Author