From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27412 invoked by alias); 14 Sep 2015 20:21:21 -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: 20559 Received: (qmail 14383 invoked from network); 14 Sep 2015 20:21:20 -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=kHnqCvsJ6+chsesV0AG2zdlxhtP2dURK+jt43nE7fuU=; b=cC+XpayDedOY0WUF0fOynT80uz9xWfc1G/xCiLdBVpCVZ3xVCGOZHDNpq6lIX0fBwu S6FjILY1z+syTi6XLE++teJ+lYNWeS03+YH+faieZfO+axhn7JtcF+K2Cal4CAntstyA Rx37WkUXkTDOlhShGIoK1HTK/Q8IL2X7O92XnM3L0BLOzD3nLau8SCS3Ooy3RfhJ6DPR Kz+cNuPGtET2YFVV6aQ2jNDQ5ghk0peMD9rfoksDpAn08F9NsW+iLd9yukH/rjlljE2y t7AWce+Dqowve4vI9ylTyHt0JkYvfcq55r4t8nuhqq1WolxptxCI+lbe7WqElK0BZkF5 R5Ug== X-Gm-Message-State: ALoCoQlPNDMEWej6QUZLwIz3R4Sn6ypMt3fuyFVrByXiIAKKgxmdSUKsvRsKpeb1sk3Uv1l659ON X-Received: by 10.202.71.19 with SMTP id u19mr12948026oia.78.1442262076789; Mon, 14 Sep 2015 13:21:16 -0700 (PDT) From: Bart Schaefer Message-Id: <150914132113.ZM26035@torch.brasslantern.com> Date: Mon, 14 Sep 2015 13:21:13 -0700 In-Reply-To: <55F6403A.1000401@eastlink.ca> Comments: In reply to Ray Andrews "Re: autoload" (Sep 13, 8:34pm) References: <55F465E6.1040405@eastlink.ca> <2125131442086868@web14o.yandex.ru> <55F4930A.40608@eastlink.ca> <150912151040.ZM12254@torch.brasslantern.com> <55F4AF59.70606@eastlink.ca> <150912164339.ZM26555@torch.brasslantern.com> <55F62DA2.9090908@eastlink.ca> <150913193803.ZM25193@torch.brasslantern.com> <55F6403A.1000401@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 13, 8:34pm, Ray Andrews wrote: } Subject: Re: autoload } } On 09/13/2015 07:38 PM, Bart Schaefer wrote: } > Would it make more sense written like ${^fpath} ? It's the operator } > that causes an array (a b c) to expand to e.g. a/* b/* c/* instead of } > to a b c/* -- cf. the rc_expand_param setopt. } Yikes, that's brand new to me, I only know the caret as negation. So } this is a feature } specific--it seems--to getting useful path expansion. No; it happens to involve path expansion in the specific example of appending /* to every element of $fpath, but that's not really what it means. The second paragraph of the doc is useful: ${^SPEC} Turn on the RC_EXPAND_PARAM option for the evaluation of SPEC; if the `^' is doubled, turn it off. When this option is set, array expansions of the form FOO${XX}BAR, where the parameter XX is set to (A B C), are substituted with `FOOABAR FOOBBAR FOOCBAR' instead of the default `FOOA B CBAR'. Note that an empty array will therefore cause all arguments to be removed. Internally, each such expansion is converted into the equivalent list for brace expansion. E.g., ${^var} becomes {$var[1],$var[2],...}, and is processed as described in *Note Brace Expansion:: below. If word splitting is also in effect the $var[N] may themselves be split into different list elements. } > (N) means nonomatch, so empty directories disappear from the result } > instead of causing a globbing error. (-) is follow symlinks, so that } > combined with (N) any dangling symlinks also disappear. These both are } > documented in the "Glob Qualifiers" subsection of the manual. } } Nuts, I scanned that page top to bottom looking at random, and there } it is near the very bottom. 'NULL_GLOB' it says. Thanks for the } explanation. Yeah, I thinko nonomatch for nullglob periodically, don't know why. } autoload n-list n-cd n-env n-kill n-panelize n-options n-aliases } n-functions n-history n-preview } } ... is actually more 'honest' since all autoload really knows at that } point is names. Definitions will be retrieved later. Yes? Yes. } > (zcompile on the other hand DOES load from locations rather than from } > a path search, so if you use zcompile + autoload -w you get the path } > stripping.) } > } Sounds like a good idea, would that not be preferable? Why not prime } the pump with both the name and the location? Compatibility with the implementation chosen by other shells that had autoloading earlier, mainly. Less importantly, for .zshrc portability, so you can autoload things without having to find them yourself in the fpath first. The inverse -- wanting to autoload a bunch of things you know are in the fpath without knowing their function names -- was not really contemplated as a common case when the command was invented.