From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25804 invoked by alias); 21 Sep 2015 18:17:53 -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: 20616 Received: (qmail 20972 invoked from network); 21 Sep 2015 18:17:52 -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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=/0yyUK+rFWEq00W5IUgFHfORvyd22TGuIzH8FzJ9bWY=; b=lHLkqeQJvMsaVL7PEx+3ZxmYgcx6A6Bx+GkmqpKHMPPBmOUmriZTbrvmGIkPF7qQ2e kev7z4Q+L56mDdWVxtpkSEUhqDZyi9S+vAJAWKKs3IcPC20SBEZ4ayxFIqXvrvW7+AQC wQjkz+2l75KHdVkLFFbPmRSJshsbseRSOVHe3E7nn+6ntGYs73q0bFzVY10e3N14LirM zeHhm7QE9az2DmGiPWtWUH3WX6/Q8kNHc4peIrF7TVwd5Ps9/8jwIE6hulePEgq/llaX Gi+DxvtiLbDQG79KISJzhC/XeHP4WufRaNboGHWqnABojmPE98VTWlDXc2dZuqdKakub gHXQ== X-Gm-Message-State: ALoCoQli9P6fCh1qOeoJHnuvTsvntOhom/Mpjm9eO7W/XEPJA65eyd8Q7Z/8fjhD6nw4TIWjr7UO X-Received: by 10.202.231.20 with SMTP id e20mr11894326oih.129.1442859468980; Mon, 21 Sep 2015 11:17:48 -0700 (PDT) From: Bart Schaefer Message-Id: <150921111746.ZM388@torch.brasslantern.com> Date: Mon, 21 Sep 2015 11:17:46 -0700 In-Reply-To: <5600386E.7060201@eastlink.ca> Comments: In reply to Ray Andrews "Re: autoload" (Sep 21, 10:03am) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: autoload MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 21, 10:03am, Ray Andrews wrote: } Subject: Re: autoload } } On 09/20/2015 09:18 PM, Bart Schaefer wrote: } > Because the language is } > interpreted, the shell itself can't decompose a file into individual } > function entry points the way e.g. a linker can for a shared object. } } Really? That's hard to fathom. I source a file and it finds whatever } functions may be in there, but they can't be packed into a .zwc file } without worrying about it's name? Did you miss the email where I explained how to do that? } I'd have thought it would be as transparent as: } } zcompile --do_it /not-the-same-directory-dummy\!/Source.zwc } /aWorking/Zsh/Source/* Really think about "because the language is interpreted." Suppose I have typeset some_critical_var_used_by_foo_and_bar=really_important_value foo() { ... } bar() { ... } Now I want to compile this. Sure, the shell could dump out foo and bar, but where does it put that typeset? Does it evaluate the assignment at compile time? (A C compiler would, but that's typically the wrong semantics for a shell.) What if really_important_value absolutely must only be interpreted once, not each time foo and bar are individually loaded? What if the names "foo" and "bar" are actually stored in other variables? function $foo { ... } What if there's an "if" structure? if some_runtime_test then foo() { ... } bar() { ... } else bar() { ... } foo() { ... } fi What if there's a runtime test with that crucial typeset INSIDE the test? 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.