From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2918 invoked by alias); 12 Sep 2015 22:10:48 -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: 20545 Received: (qmail 19253 invoked from network); 12 Sep 2015 22:10:47 -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=M1zx+D8Kr2vw7u8yjn0T6W+WxOdfC+2iZg/yykRuj18=; b=mTf9ICexIL30eLn5T1Oidb4AanpvbSMbUEOQOQWUt6dLe8L8QgX1CD+oM7dXup//XS 05kuoM3lbXicZF6hUs1Thq+F93z7qN/Uwomuc0UgxuqDu91c40ZJv0flXYQSfcBO8mjt pplx7DeFViO27xrXC6kLLmuhkbePBq7nkZFail/wPMJGLWtzRpiTOsx0OpkPOQyl4qqf RoFpedDH8glUnEay7ladGKuwUHaX8Edkk2IUx9RsiuibXCbGDNl+ztkrJXxEufuIFb0V V8DbDSB+m5yhHNd05wJfWZgIJzcUPzKWPUKEm/OGyOIOKk5xQEnOzE5Xee+RYGlVwzPP CDxw== X-Gm-Message-State: ALoCoQkt4SE29uSgaHznwSfVs/z/VAu9aXhKGHBUScs9DgwrzjGNc1HDrMXMtDJVRb4jnoTrDwWl X-Received: by 10.60.124.230 with SMTP id ml6mr4685310oeb.81.1442095843695; Sat, 12 Sep 2015 15:10:43 -0700 (PDT) From: Bart Schaefer Message-Id: <150912151040.ZM12254@torch.brasslantern.com> Date: Sat, 12 Sep 2015 15:10:40 -0700 In-Reply-To: <55F4930A.40608@eastlink.ca> Comments: In reply to Ray Andrews "Re: Announce of Zsh Navigation Tools" (Sep 12, 2:03pm) References: <55F465E6.1040405@eastlink.ca> <2125131442086868@web14o.yandex.ru> <55F4930A.40608@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Announce of Zsh Navigation Tools MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 2:03pm, Ray Andrews wrote: } } What are the pros and cons of doing things that way vs. what might } seem to be the more obvious function definition? It's more compact, } but then requires the special calling via autoload. I expect there } will be some substantial difference. There isn't (intended to be) any execution-time difference. If you can find one, it's probably a bug, except for the variations that are implied by (misapplication of) the -z / -k options of autoload. The main benefit is that you don't have loaded into memory those functions that you don't use. The not-yet-loaded form of an autoloaded function is very small. You also avoid a lot of the startup time of parsing all those files. E.g., the completion system is now nearly 10MB; why read all of that when most of it may never be used? I suppose, conversely, the drawback is that there may be a delay for parsing, the first time any such function is executed. Another drawback is that you can't easily switch among different emulation modes without taking special precautions, because the parse will always be applied using the mode at the time of first execution rather than the mode when the autoload command was issued. We could probably stand an autoload option to apply "sticky emulation."