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 C0785200C00 for ; Wed, 18 Jan 2017 15:19:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BF0C3160B3A; Wed, 18 Jan 2017 14:19: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 1668D160B34 for ; Wed, 18 Jan 2017 15:19:25 +0100 (CET) Received: (qmail 68090 invoked by uid 500); 18 Jan 2017 14:19: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 68079 invoked by uid 99); 18 Jan 2017 14:19:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2017 14:19:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0C4291A0017 for ; Wed, 18 Jan 2017 14:19:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 0ZhGoKyc85fJ for ; Wed, 18 Jan 2017 14:19:21 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id F30505F477 for ; Wed, 18 Jan 2017 14:19:20 +0000 (UTC) Received: from [192.168.10.2] ([77.177.143.105]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MXIGf-1bxZ4u1lNl-00WIhs for ; Wed, 18 Jan 2017 15:19:13 +0100 Subject: Re: SAM type closure coercion To: dev@groovy.apache.org References: <48A7BAB8-436C-492D-B892-C525A1ECBCD6@selskabet.org> <1264538691.1129516.1484739231314.JavaMail.zimbra@u-pem.fr> <02b067fb-1cab-5ed2-0574-0d59c38a83ec@gmx.org> <8e879462-1a56-14d4-5188-5d1f458860fb@gmx.org> From: Jochen Theodorou Message-ID: Date: Wed, 18 Jan 2017 15:19:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:9XGsQsEVNJl6/gRfZEafm7fKaajBLsJSsK8vwwHARXWhImgpqDw Xx7N+uxpGS1aYcJKwZsx5MuY8KZtEuZZ+/B1zGuUIqJzpoC07OboRjcMtdHJr7xlcS5k7yt I08a6kYkG72ei5L1XFvIFJYWT0snezRcnvKP1rJg/DxhWWbmzpacVnmZLLGOOKKM6QqGA5O DAAVCuZ/noIqWWtdxgmvA== X-UI-Out-Filterresults: notjunk:1;V01:K0:ooiIxCAywoA=:d+PeIwJkIfIYSwxe/pgOQU Zv73+bVeahSb62d2EQ+IXzoUfDPvDjYZvrp4cg3A9n+H0v8Mxij+7SRblZRjGIknO+p1hig4r Pke3WkaAmCcuqY/enl2MW6RvOAUxrs+DAxCC0ADavmrum32BCBjM3/EB0lV//HL33MHOSLwFR mBr4/Z4LvW1K25vWBZ8TcMXt4x6WXbkS8NpJcpzKhoSb2tSyNlB0M4UsO04fGqCKAyuAwFNVZ Nd1AkQxG3l+ePzBteMTyKmIQMsIdFIfofMmFsijIzQq/VpsETNxT4HSoxkxlkQaYmVA66XT4w VR0tIKSi1F7oCSjDtnSwB92q2aXEO/oT/U2G+D9Ib9POTno5772GFn005hEdWFogLtFutUQUb CL3Wu9YN2HXAVhdhi0qkDU5o9W9bPTd20DvSbHjUFjh70TzvHdmo10BkEL3pSJo8jlwrg59Us IM7kOryYKAJxscw73QdtD6vGcI4kTkvag6fusxD2DBEHLfR/ftDFPnlu92NSaIndvpeZvEHJY CGxRGcGvvg5IuVlQxA0oGEk0O4WovyTA2Ieaox+RBj5tJt1OIheHgVAS6MWJjBuadBH1RRHfX QRqfWFUU7yIqH9Ar0XUiWCQqGHOzwrH/ID+GbePwGhc4OGR2ww0hECnFYuZ7ZfOeINfr65kNb n0uGn0vLQD3dvxQJyhRD8SqMqRtT+yGEZf3gWqOXHqg2WXRTuzZTpD88G5YQfM2oJfRihoGKD 32kTvKNtf9m4bGdW3S1qzLF7qS+sYMOSt0/HiKElBKyMZu+JDDuJtuMIaFCS9n898fj7ZrrSm vpREouL archived-at: Wed, 18 Jan 2017 14:19:26 -0000 ok, I see... we currently do not make use of that information, but could. Only trouble is that we will be "less expressive" than Java for these cases. bye Jochen On 18.01.2017 14:39, Andres Almiray wrote: > I meant that { String arg0, int arg1 -> } gives us arity and types, > whereas { arg0, arg1 -> } only gives arity. > Also compare { List arg0, int arg1 -> } vs { List arg0, int arg1 > -> }, the former should be doable whereas the latter will prove difficult. > > This is what I meant by plain typed arguments. I explained myself badly > and left out "generics" from the previous message. > > Cheers, > Andres > > ------------------------------------------- > Java Champion; Groovy Enthusiast > http://jroller.com/aalmiray > http://www.linkedin.com/in/aalmiray > -- > What goes up, must come down. Ask any system administrator. > There are 10 types of people in the world: Those who understand binary, > and those who don't. > To understand recursion, we must first understand recursion. > > On Wed, Jan 18, 2017 at 2:22 PM, Jochen Theodorou > wrote: > > > On 18.01.2017 14:09, Andres Almiray wrote: > > Agreed. > > I almost forgot about the special arity case of defining a > closure as { > /* do something */ } as it can be called with either 0 or 1 > arguments, > where as { -> } accepts no arguments and { x -> } takes exactly one > argument. > > Would it a a good compromise to support plain typed arguments > out of the > box, that is { String arg0, int arg1 -> } vs { arg0, arg1 -> } ? > > > nothing prevents you from writing { String arg0, int arg1 -> } > today. And yes, we can make that this helps. > > bye Jochen > >