From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12500 invoked by alias); 30 Sep 2015 04:15:06 -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: 20665 Received: (qmail 25593 invoked from network); 30 Sep 2015 04:15:04 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=62AtbbSsrca3scplPJj5lw==:117 a=62AtbbSsrca3scplPJj5lw==:17 a=N659UExz7-8A:10 a=uPtGb7S9oNJuy3HormEA:9 a=pILNOxqGKmIA:10 Message-id: <560B61C5.2080001@eastlink.ca> Date: Tue, 29 Sep 2015 21:15:01 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: wheels within wheels References: <55FAE223.2080502@eastlink.ca> <150917103419.ZM10067@torch.brasslantern.com> <150918171441.ZM27212@torch.brasslantern.com> <55FD7982.9030505@eastlink.ca> <150919092922.ZM28214@torch.brasslantern.com> <55FDA5D3.9020304@eastlink.ca> <150919142243.ZM23634@torch.brasslantern.com> <55FE04AD.1070304@eastlink.ca> <150919224120.ZM4736@torch.brasslantern.com> <55FF3F7E.4060906@eastlink.ca> <150920211840.ZM31871@torch.brasslantern.com> <5600386E.7060201@eastlink.ca> <150921111746.ZM388@torch.brasslantern.com> <56006401.5060902@eastlink.ca> <150921201943.ZM707@torch.brasslantern.com> <560B1BE7.8020507@eastlink.ca> <150929204047.ZM9646@torch.brasslantern.com> In-reply-to: <150929204047.ZM9646@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 09/29/2015 08:40 PM, Bart Schaefer wrote: > } > } I just learned that it's possible to declare a function within another > } function. A strange liberty. > > Interpreted language. Yes. It's so easy to forget that. > function foo { > echo defining bar > function bar { > echo hello from bar > } > echo redefining foo > function foo { > echo hello from new foo > bar > } > # this looks like infinite recursion, > # but it is not, because foo was redefined > foo > } > > Now that is mind expanding. If you tried that in C you'd collapse the universe. Interpreted .... sure, it can saw off the branch it's sitting on because there is no tree. Each command is past when it's past so that must mean that the address of first foo ... is there ... yes of course there is, the thing is in memory ... just aborts when second foo comes along. It will expect grammatical completion of first foo for the sake of etiquette. And when foo calls itself, it calls new foo which is not recursive. I am not yet able to snatch the pebble out of your hand, but that's a zsh koan.