From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3525 invoked by alias); 16 Mar 2018 16:47:56 -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: List-Unsubscribe: X-Seq: 23248 Received: (qmail 1931 invoked by uid 1010); 16 Mar 2018 16:47:56 -0000 X-Qmail-Scanner-Diagnostics: from mta03.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.9):SA:0(-2.6/5.0):. Processed in 2.123064 secs); 16 Mar 2018 16:47:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8; format=flowed X-Authority-Analysis: v=2.3 cv=dfKuI0fe c=1 sm=1 tr=0 a=RnRVsdTsRxS/hkU0yKjOWA==:117 a=RnRVsdTsRxS/hkU0yKjOWA==:17 a=IkcTkHD0fZMA:10 a=g2ZXVDaDFgFuqMqPhQIA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 Subject: Re: real time alias? To: zsh-users@zsh.org References: <98aa0638-97ed-dfe0-8dd2-39129d02c084@eastlink.ca> <9001d78e-91fd-8505-518f-27247462d3c2@eastlink.ca> <20180315214450.sle4bsb3ab6dt56i@prometheus.u-strasbg.fr> From: Ray Andrews Message-id: Date: Fri, 16 Mar 2018 09:47:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-reply-to: <20180315214450.sle4bsb3ab6dt56i@prometheus.u-strasbg.fr> Content-language: en-CA On 15/03/18 02:44 PM, Marc Chantreux wrote: > my advice is: see aliases as macro: don't use it as long as you can > achieve things with functions. one of the reasons is aliases can be used > after a variable expansion and so you can get some surprising behaviors. Yeah, I know what to expect, I'm mostly just curious about possibilities. $ alias test2="echo this is the original alias test2" $ function test3 () { echo this is function test3 } $ function test1 () {     test2     test3 } $ alias test2="echo changed alias test2" $ function test3 () { echo "test3 is now changed" } $ test1 this is the original alias test2 test3 is now changed ... to be honest I can't even think of a reason to want anything more than what we have,  but I was curious.  One might imagine: $ function test1 () {     test2 # unchanged since last sourcing of this function.     setopt GRAB_ALIASES_AGAIN test2     test2 # Up-to-date.     test3 } Nevermind.