From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17790 invoked by alias); 19 Nov 2014 00:45:43 -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: 19408 Received: (qmail 3 invoked from network); 19 Nov 2014 00:45:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=LfW0gV3imRlfmwcogLTmWPIXnZU0exwyWd1wVdRuyHU=; b=TE2UlhQXjZTTM5Jek6tsG9jbAtEQ7kdLdrH2OK3iV+/kKi+c8AH6dfSwikbtuJmFkJ G4deHAulNMXRtQi5PeHaUxZAxt/er6y1bXFiWt7GlHdHOkYsB0lBkX3LqrjnmhE1FFfI Xxbxk1HG7YjUnJ7RvlwNAJvHnkdNIDr5R22FtpwgVnyr+ah9WhvJF+LYuDR9LE2G7Ebi YuvJKroBSkp/g4Tu1aRHraFVpkxAiIGxuw7uPzUFpH/J7fqal4nxqvcjHiVIcCf0pi+Q bM1Xl1t8B5M1Oz8lpbnKv+iaZQ/gNr6CaNKrTzL6z6ada3dfmEbLQ5y5v16U7HIEIyXu swiA== MIME-Version: 1.0 X-Received: by 10.202.205.200 with SMTP id d191mr556861oig.37.1416357935508; Tue, 18 Nov 2014 16:45:35 -0800 (PST) Sender: xiong.chiamiov@gmail.com In-Reply-To: References: Date: Tue, 18 Nov 2014 16:45:35 -0800 X-Google-Sender-Auth: lNeL1hM2qmf_umujqfZ6Y2bNHqY Message-ID: Subject: Re: Function or Alias - Does it matter? From: James Pearson To: TJ Luoma Cc: Zsh-Users List Content-Type: multipart/alternative; boundary=001a11c17b629f025105082b8780 --001a11c17b629f025105082b8780 Content-Type: text/plain; charset=UTF-8 Functions can take arguments, which makes them more powerful for future expansion. I forget if functions and aliases are treated the same by which (as I recall zsh expands both of them). On Nov 18, 2014 4:15 PM, "TJ Luoma" wrote: > Is there any practical difference between making an alias or a > function if they do the same thing? > > For example, these are (as far as I know) functionally identical: > > function timestamp_r { strftime "%Y/%m/%d at %-I:%M:%S %p" > "$EPOCHSECONDS" } > > alias timestamp_r='strftime "%Y/%m/%d at %-I:%M:%S %p" > "$EPOCHSECONDS"' > > Is there any reason to prefer one or the other? > > Tj > --001a11c17b629f025105082b8780--