From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26787 invoked by alias); 2 Mar 2015 19:19:29 -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: 19961 Received: (qmail 27792 invoked from network); 2 Mar 2015 19:19:27 -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,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=MgQ9fWQ1i0NNliEsFkhyxOy4jeVcQuJkpK+W/h1paFQ=; b=lfMHCN1YDfcrKKazcmgE1xJjBprLT2MMTklDC70DWmIlqqMPbU/ik/Hn7GUauR3iRL 5HI1/ze5Y79DL+IFgZLmZddIhSl27oYThQMvs5nUzrzr6LHo26pj+rEbd0WZrC611uh0 2PFdCr8ZIiv+gmY8qWBHvdFCkRcPSFQ9hwz9pTmPzxZE44n9/UIwxNwjU5oH+bUG0a6A rTLVYlGugjVI/K817qLobAsYPLJmGyt9aLQEqOQFKu4CadhcMRzOrr/howYmr+9OrYVt FnSw3LUcez6/USjMzMzvL+M5crBO6tA4+CEh+6ruF1NWwALZM7tjTcYIAwtxAlTVdIIA S0EQ== X-Gm-Message-State: ALoCoQn0GjZLFzZrhjRfSHf6SKC3EIQYvrvYcMizotyaxD3fIme+syPY8wxkOs5P/+csnjWBgfzL MIME-Version: 1.0 X-Received: by 10.180.75.243 with SMTP id f19mr30930977wiw.94.1425323965728; Mon, 02 Mar 2015 11:19:25 -0800 (PST) In-Reply-To: <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> References: <54F33934.2070607@eastlink.ca> <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <20150302022754.GA7449@xvii.vinc17.org> <20150302104619.GC6869@xvii.vinc17.org> <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> Date: Mon, 2 Mar 2015 11:19:25 -0800 Message-ID: Subject: Re: grammar triviality with '&&' From: Bart Schaefer To: Zsh Users Content-Type: multipart/alternative; boundary=f46d0438951baae06e051053182c --f46d0438951baae06e051053182c Content-Type: text/plain; charset=UTF-8 On Mar 2, 2015 3:17 AM, "Peter Stephenson" wrote: > > > % andfn() { > integer stat=$? > (( $stat > 0 )) && return $stat > return 0 > } > % alias and='andfn &&' % alias and='(){ return $? } && ' (Trailing space thrown in to expand aliases again in the next word.) Heck, for most purposes you don't even need $? preserved: % alias and='(( $? )) || ' Heck #2, let's just invent some new operators: alias -g @@=';(){ return $? } && ' alias -g ::=';(){ return $? } || ' --f46d0438951baae06e051053182c--