From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10228 invoked by alias); 21 Sep 2015 20:09:42 -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: 20617 Received: (qmail 14116 invoked from network); 21 Sep 2015 20:09:39 -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=T/C1EZ6Q c=1 sm=1 tr=0 a=NzxVjh620SjOIGLlnxV8Cg==:117 a=NzxVjh620SjOIGLlnxV8Cg==:17 a=N659UExz7-8A:10 a=mTiSAaHvVsfkZcC7G5kA:9 a=pILNOxqGKmIA:10 Message-id: <56006401.5060902@eastlink.ca> Date: Mon, 21 Sep 2015 13:09:37 -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: autoload 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> In-reply-to: <150921111746.ZM388@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 09/21/2015 11:17 AM, Bart Schaefer wrote: > Did you miss the email where I explained how to do that? On the first pass through a subject like this there is so much to learn and so much error and misunderstanding and diversions and distractions that one is lucky to come out of it alive. On the second pass things will gel. > > Really think about "because the language is interpreted." Deep lessons ... > > I can make up an infinite number of increasingly convoluted cases to > break any "simple, elegant" automation. So unless you happen to have > "zmodload zsh/artificial-intellgence" lying around ready for use, I'm > done with this discussion. > I'd just expect the precompiled function to behave exactly as a sourced function would behave, all that's different is that the file being parsed is ... is this where I go off the rails? ... what I'd call 'object code' which is to say that it's somewhat pre-digested as far as the interpreter goes. But when it is actually called (as if it were sourced) it would behave exactly identically to a normal sourced function. It's just parsed quicker. Very different from C, as you say. I dunno, if I have a function ' test () { echo $PWD } ' I'm not expecting $PWD to be hard captured at sourcing time, is there even a way to do that? It might be cool if there was a way, but surely that's rather unusual. So, on the contrary, I'm thinking not of artificial-intelligence but rather of something dumb as a donkey. Autoloaded functions at present seem to behave as I'd expect, so I don't know where the problem arises. Your 'evaluate once' scenario is valid of course, but I have no idea how that would be handled even by a regular function. It seems a separate issue to me. To be honest, your stamina sticking with this so long has already astonished me, so if you're done, that's overdue, but thanks.