From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24761 invoked by alias); 25 Nov 2015 09:26:02 -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: 20987 Received: (qmail 25200 invoked from network); 25 Nov 2015 09:26:00 -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 Date: Wed, 25 Nov 2015 10:16:18 +0100 From: "Christoph (Stucki) von Stuckrad" To: zsh-users@zsh.org Subject: Re: [Zsh bug] function define bug Message-ID: <20151125091617.GA1649@localhost.mi.fu-berlin.de> Mail-Followup-To: zsh-users@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "Chr. von Stuckrad" X-sent-by-salt: leibniz.imp.fu-berlin.de X-Remote-IP: 160.45.113.41 X-Spam_Score: -3.5 x-exim-Spam_Score_Int: -34 X-exim-Spam_Bar: --- X-Spam_Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Originating-IP: 160.45.117.149 X-ZEDAT-Hint: R On Wed, 25 Nov 2015, Ngô Huy wrote: > I don't see reason for multiple functions have same body but different > name. Let's me know if I'm wrong :) There are some programs, which do different things, if called by different names (mostly links or symlinks to the same binary). So to 'wrap' such a beast you'd need to wrap lost of names to the same function, which inside it would call something like { command $0 "$@" } This is the only case I ever used somethng like lots of different names at onece real_name() { wrapper contents } to define all the things at once. Stucki -- Christoph von Stuckrad * * |nickname |Mail \ Freie Universitaet Berlin |/_*|'stucki' |Tel(Mo.,Mi.):+49 30 838-75 459| Mathematik & Informatik EDV |\ *|if online| (Di,Do,Fr):+49 30 77 39 6600| Takustr. 9 / 14195 Berlin * * |on IRCnet|Fax(home): +49 30 77 39 6601/