Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBBEE200D15 for ; Thu, 5 Oct 2017 09:07:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4B341609E1; Thu, 5 Oct 2017 07:07:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E22031609DA for ; Thu, 5 Oct 2017 09:07:25 +0200 (CEST) Received: (qmail 66880 invoked by uid 500); 5 Oct 2017 07:07:25 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 66870 invoked by uid 99); 5 Oct 2017 07:07:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Oct 2017 07:07:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E4AE418094E for ; Thu, 5 Oct 2017 07:07:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.765 X-Spam-Level: **** X-Spam-Status: No, score=4.765 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=bahmanm-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ljfbWlZrlnNc for ; Thu, 5 Oct 2017 07:07:21 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D1DB95FB2E for ; Thu, 5 Oct 2017 07:07:20 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id l23so8990735lfk.10 for ; Thu, 05 Oct 2017 00:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bahmanm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=EQYLJqkDQbnbeQfmiyYssNcU41+UJMKxPi8mKGlvaMk=; b=0FZwqsfqpNy8LWluJ9qjwUiCzsmIB2ope9uftm+5RUmaSCr472Xitz0KgtcVmgLsV6 HD66deITigPc2rckt9sre6KxNu/mgMkRgbcNEB0RkIre1cAabZjNkeBwJ1yhw1dFrKrG ADigpvV9P5QmgDTSmKWAoqox5UA+fHhtgrD6gQPKeC1Tv96kVZeZP0uztJLb9c2LelQy CZL6zypvn2r64g5oA8JSi845qvoFKEzagQG6lwiY5KnufFOCLVe11qFx6a7BH9MR0dHL xMJAno7J+GB+gvHhgQl6r3LPpON7/5CYwpMqQtVNzahz3zfRvuiNb4AnelcW/PXIwWtZ vFFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=EQYLJqkDQbnbeQfmiyYssNcU41+UJMKxPi8mKGlvaMk=; b=Ca0yAuhr8NB48OSalbt3N7Tz4eWECmX7jeSEk4J+Gys+XnOPtBevurvOOc2fWQtap+ UNp/vU4GsYk7QnVynRYadtHUmSmxqbqQwClNITuE8MyPjofTNbEVj9dbhtS3sOXznFx9 mV1Zmc3rcJ8jbfUVvrFpRevj3EqphjifcSvlZpEjE0ZjJUUJHW0z4E/N8Kyvqr+EqKGS INqwts3sA6V3bvFGsrvBrB5n8r0T53WQuoPntbNsKW8vlvMxdY5obMB8N7iU0ijerCMU I6/sigKJmiE13dqwHIiw3DYNN60oYBfep+We1EDI2F6O9iz80yHqkBAiPSdFY1rPGtvJ 0chw== X-Gm-Message-State: AMCzsaX0ByxekT0WZtpr7h8b56PD6x3hEQNBfRoOZFurDCcIwG7hy1hm 6FMWMwrQXfUw576clWUFPI18DR0HT9MgIOb+ZWJDdEVeQX4= X-Google-Smtp-Source: AOwi7QD893zyuK3FfA9lCvDy57pY8ZXQF2dVUc9/pUfGwCFaaI19VVjTyK73+IdfiKZAGeY2EvX2WC/8Iblmw8/aCVs= X-Received: by 10.25.20.228 with SMTP id 97mr4393505lfu.211.1507187240090; Thu, 05 Oct 2017 00:07:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.195.78 with HTTP; Thu, 5 Oct 2017 00:06:59 -0700 (PDT) X-Originating-IP: [141.8.49.103] In-Reply-To: References: <1506483468614-0.post@n5.nabble.com> <1507180705716-0.post@n5.nabble.com> From: Bahman Movaqar Date: Thu, 5 Oct 2017 09:06:59 +0200 Message-ID: Subject: Re: About if statement in the right hand of assignment statement To: dev@groovy.apache.org, paulk@asert.com.au Content-Type: multipart/alternative; boundary="001a113fa8480e5941055ac7605e" archived-at: Thu, 05 Oct 2017 07:07:27 -0000 --001a113fa8480e5941055ac7605e Content-Type: text/plain; charset="UTF-8" You have a valid point. Though from a user's point of view, I'd say using a relatively quick but non-optimal implementation has the benefit of testing it in action sooner and making sure it doesn't have side-effects or doesn't introduce backward incompatibility. On 5 October 2017 at 08:30, Paul King wrote: > Nice - though I still wonder whether wrapping within ClosureExpression was > the way to go. > > On the one hand, it makes it clear what return means if you added it in > such a statement (provided you know it is wrapped that way). On the other, > it means that normal if/then/else supports non-local returns but > if/then/else within a declaration doesn't. This is possibly going to be a > little confusing. > > I'd be keen to know what others think. I'm keen to keep the feature but > wonder whether a slight implementation tweak is the way to go. In either > case, we need to document it well. > > Cheers, Paul. > > > On Thu, Oct 5, 2017 at 3:51 PM, Bahman Movaqar wrote: > >> Beautiful! >> >> >> On 5 Oct 2017 7:18 a.m., "Daniel Sun" wrote: >> >> The new feature has been implemented, it will be available in 3.0.0 and >> 2.6.0: >> >> https://github.com/apache/groovy/commit/35ae8e484020f2d11b2d >> d9c7efa3740ee527fa70 >> >> >> Cheers, >> Daniel.Sun >> >> >> >> >> -- >> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html >> >> >> > --001a113fa8480e5941055ac7605e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You have a valid point. Though from a user's point = of view, I'd say using a relatively quick but non-optimal implementatio= n has the benefit of testing it in action sooner and making sure it doesn&#= 39;t have side-effects or doesn't introduce backward incompatibility.


On 5 October 2017 at 08:30, Paul King <paulk@asert.com.au&g= t; wrote:
Nice - = though I still wonder whether wrapping within ClosureExpression was the way= to go.

On the one hand, it makes it clear what return m= eans if you added it in such a statement (provided you know it is wrapped t= hat way). On the other, it means that normal if/then/else supports non-loca= l returns but if/then/else within a declaration doesn't. This is possib= ly going to be a little confusing.

I'd be keen= to know what others think. I'm keen to keep the feature but wonder whe= ther a slight implementation tweak is the way to go. In either case, we nee= d to document it well.

Cheers, Paul.

On Thu, Oct 5, 2017 at 3:51 PM, Bahman = Movaqar <bahman@bahmanm.com> wrote:
Beautiful!


On 5 Oct 2017 7:18 a.m., "Daniel Sun" <realbluesun@hotmail.com> w= rote:
The new feature has been implemented, it will be ava= ilable in 3.0.0 and
2.6.0:

https://github.com/a= pache/groovy/commit/35ae8e484020f2d11b2dd9c7efa3740ee527fa70<= br>



--001a113fa8480e5941055ac7605e--