From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11021 invoked from network); 20 Apr 2021 15:30:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Apr 2021 15:30:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=UNkSjZbql7naJI1eyN1XktRc7M0D2Atv4GrX/l6Gn5I=; b=ABIFCvNESIgFrmcguv1T0QKfcs hew0qO2pc5t3/FcZFdKlMzQoFkBDL1+B8bUsc3p+iLiErBF31qxxAhl6icN6hfEDofBYAW0S/6Dyo gVn9qbHk43I0onKtOBhCcE1hSbt0jG4BJrZw2cZMl9Tj5kbBj8S72rzcL0OhaxkmNW/KFTpCq6Ld2 x1LsmsWevpWQbEUqlMJIo/BIbE32V2NafIgUJrv1cfUBbj9+fiOGtrzu/z1BxEPxTUdqoj5G0wHGO cA0KR93Tsk82XrbzTqt8bE4voZoovv5Cr3EIKkDL+tFF3MEUBt3Xl0pTBPgSmrth2iGZ4orkfLHf7 o2ICvaFw==; Received: from authenticated user by zero.zsh.org with local id 1lYsK8-000Gog-D1; Tue, 20 Apr 2021 15:30:00 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lYsJB-000GBl-Cq; Tue, 20 Apr 2021 15:29:01 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 9893D27C0054; Tue, 20 Apr 2021 11:28:59 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute1.internal (MEProxy); Tue, 20 Apr 2021 11:28:59 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtiedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepnfgrfihr vghntggvpgggvghljoiiqhhuvgiiuceolhgrrhhrhihvseiishhhrdhorhhgqeenucggtf frrghtthgvrhhnpeeikeejveeludegfeeigfeulefggfdttdegheevvdehvdeigfehvdff uedvvdeuheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehlrghrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedu keejjedtgedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsth hmrghilhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9ACBCA00079; Tue, 20 Apr 2021 11:28:58 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-380-gda4c716772-fm-20210419.004-gda4c7167 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <1154b0e1-e5ad-70be-f620-1368c86f12ed@rayninfo.co.uk> Date: Tue, 20 Apr 2021 11:28:14 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Marc Chantreux" , david Cc: zsh-users@zsh.org Subject: Re: if (()){}else{} documented? Content-Type: text/plain X-Seq: 26680 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Tue, Apr 20, 2021, at 11:19 AM, Marc Chantreux wrote: > all the following examples works fine there. i'm even surprised about > this one > > > joe(){ [[ $1 > 4 ]] && echo big || echo small } > > this is a math expression so i would have written > > joe(){ (( $1 > 4 )) && echo big || echo small } You'd be right because the original version is wrong (unless OP *wants* lexicographic comparison and just didn't say so). % joe(){ [[ $1 > 4 ]] && echo big || echo small } % joe 5 big % joe 10 small -- vq