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 1904A200BA5 for ; Wed, 19 Oct 2016 15:03:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 17B0A160AEA; Wed, 19 Oct 2016 13:03:50 +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 5AECE160ADE for ; Wed, 19 Oct 2016 15:03:49 +0200 (CEST) Received: (qmail 68423 invoked by uid 500); 19 Oct 2016 13:03:48 -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 68412 invoked by uid 99); 19 Oct 2016 13:03:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 13:03:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8B6B0C274D for ; Wed, 19 Oct 2016 13:03:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.702 X-Spam-Level: X-Spam-Status: No, score=-0.702 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aGY1j2TZ7LuH for ; Wed, 19 Oct 2016 13:03:46 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7BB005FC9E for ; Wed, 19 Oct 2016 13:03:46 +0000 (UTC) Received: from [192.168.10.3] ([77.177.233.2]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M6RmV-1ctUb248vD-00yOtt for ; Wed, 19 Oct 2016 15:03:32 +0200 Subject: =?UTF-8?Q?Re:_=e7=ad=94=e5=a4=8d:_Lambda_expression_for_Groovy_3?= To: dev@groovy.apache.org References: <5806CC8E.2080308@gmx.org> <1476872589837-5736195.post@n5.nabble.com> <579179514.1261965.1476872998580.JavaMail.zimbra@u-pem.fr> From: Jochen Theodorou Message-ID: <0d680ce7-d006-6e64-dde2-e0a952c119cf@gmx.org> Date: Wed, 19 Oct 2016 15:03:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:XGR3QcvI7bHXUBe64ND+lWHky5h1Knc8JVwb6SFotM0XIa0nMEJ Z8hFgJhcSlbNrFV+qfj1EJKslRKuCg5G5OzTzJoj6blRR8qsPdP0ICBMDH20pVn5Uoej0HM 26DJ6sis5nCBLbZ9rogM+qLNrMqGMeQufzPpH22yEuG7gquk6Ojg6HAnwL+yi/EFe0oH1Sz SpnkkJf5jJSH86dT3mvsw== X-UI-Out-Filterresults: notjunk:1;V01:K0:qqPZnlJwWF4=:U7MdmWhxulX9+TrsmZpM7B /1349ViU5OBLP7XSh9Z0Uoi5om2/4j2IHY8qgFuP2JlvpYX10JFp7UABR0pSqcUedSii3aYB2 I5gMqcKnMKM1d25T/VOAzo1KzkthhlVtA4ftslnbbG8awAK+NHR0f0OatHplyYVT8KAEsM1ot kQkoEdwDhqv0Cq32emJ9ehISri17TLsEvKlRF4q5kQSKyYUrNihqFkGf9qdANylPKoqkAfYt4 RY4C5EgWz789DdCYxi41CpuvxRHLEnd/l3LGkqv3FOi23I2/vTxxt3wooV829/9RqrBeevSnt w7fsN23+Ks6sfBy9aVS/pRP1oxMoknxkVQzZ/+Oz+Objru4dpWT0bTWwxPM8mXhaaGilQc89v bgLYR806lXV6Y6To4WH5tJvf3GfK7ldDjYbjRaeDuUenDsJFP2QSVvJ5hyFhF/pgUFWDN+o+b l2efN+xMdFCSz04TGaJPBNy9NFJbdEUFWPWeUa8PzHFdBmbxx3EN6gPNyKPpn4ym4iAiLG2tB Jjd1rF0KxfDYZBu1lOzVkYKd6VFuWfDMnjnsvslZZy56mLgqme2drDMlbnmx8usCgIx7gt/jm XsMphalr7ELONYSCR4ZpnTNADomE4z00tV53tvQOzhvC8asktlC+tNINHftNhuv/NaNwXa+Ta dJWTFfrIMvPOS6JIz+Qr1nE2Sp3ckE9ucSJCp9PdnIigqprX1zqvY6SmZ7qdmoOrcbnor7P4D WenkF1/xDMpGdibJKRR7PMHBdNtDtCa0QHpSyYtdHAn2qpR+0bUqE//XhsI9xIV6RyGUMQbq+ ao35Lh1 archived-at: Wed, 19 Oct 2016 13:03:50 -0000 On 19.10.2016 14:12, daniel_sun wrote: > Hi RĂ©mi, > > Groovy can choose the right method to call :) > > assert ['1', '2', '3'] == [1, 2, 3].collect(Integer.&toString) I am sure that works only because the static Integer.toString(int) and the virtual Integer.toString() return the same values. If you look at > class X { > def foo() {1} > static foo(X x) {2} > } Then for a X.&foo covering virtual and static methods, there is no way of knowing if we want to call the virtual foo or the static foo method. Both would take and instance of X as argument. bye Jochen