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 49550200C06 for ; Fri, 27 Jan 2017 19:56:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 47DBB160B5B; Fri, 27 Jan 2017 18:56:23 +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 93E26160B40 for ; Fri, 27 Jan 2017 19:56:22 +0100 (CET) Received: (qmail 91583 invoked by uid 500); 27 Jan 2017 18:56:21 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 91573 invoked by uid 99); 27 Jan 2017 18:56:21 -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; Fri, 27 Jan 2017 18:56:21 +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 06AC118C852 for ; Fri, 27 Jan 2017 18:56:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id PkdtapSTLaSu for ; Fri, 27 Jan 2017 18:56:20 +0000 (UTC) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 1B9F95F4A7 for ; Fri, 27 Jan 2017 18:56:20 +0000 (UTC) Received: by mail-yw0-f174.google.com with SMTP id v200so23194120ywc.3 for ; Fri, 27 Jan 2017 10:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=JGs0z6M1O0/jWxQwg9XWJO982cE+M6DThFRpvW3rE8A=; b=ebuVoLk51Igf7DZ4OM64Ba/2CpO5DOO63+Ostcd1ZKTHvn4j3+dSNGKQKqtJWAOfaM k5iA/BUikpZNOoUaNbdji9++VQz6JHzLAYBdES/sOAXukOxzBh/lM+KQXfVigHW7/L/Z Ihdu5GGg+ncKrqQorCnOBnxIWS0MUV6rx20pzd312pAriFYT3TxZROCZewjN5xT+3C2v AIrHxEv7vZp5DmRlC6jCnFWw4VhceUJ9ZtOdlVm8XgzXwunNx8VR2RXk6vQPMu6GS3T1 nubSZiZZVBXNUuIXVzBqPhHVQKnG5DglTPawWinBAm+Lxd4yZJ9BrdEM8/km2zGv4PF+ TznQ== 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=JGs0z6M1O0/jWxQwg9XWJO982cE+M6DThFRpvW3rE8A=; b=W2mu1J7o7l8Si4dddiQralJPqj/ll3lEllb0k+AkGj+TNDht2r+hCYibXId1C60PDF ZATvb1OtkXQhPae2x7lztcsQZ+jPENbz5zA4es5Q9flmhVXDrAUV5TJuaHv048Yf1IQ6 lGNjKfdmXpTPHA1qPw5SaF4CawovOhAkbsWQcad9vrvvwYzbhPaQO8CXp7p8VRA0ht+y C1MXqUn/ebLm23IKCPbopCbVagAtDz1L5h9ymYqbuYdDljbNn0eDM3hG8SwZP/JMOQGv FM5t135PU94YR4YFLNe7dfKUDKeou1GaBq5B/WRRrqdS70v5UL9WhzL1QX1vK6UZ5T0r 1a8g== X-Gm-Message-State: AIkVDXIYgBjHxZKZzgsm4MWYHSThf5poIcvM0s3f7JBgcKAOKCasUgLjWrOEvgjYf78Cq+pE6BNAAw8L4FcOjw== X-Received: by 10.55.38.4 with SMTP id y4mr4053752qkg.14.1485543379487; Fri, 27 Jan 2017 10:56:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.33.136 with HTTP; Fri, 27 Jan 2017 10:55:59 -0800 (PST) In-Reply-To: References: From: =?UTF-8?B?RGlua28gU3Jrb8SN?= Date: Fri, 27 Jan 2017 19:55:59 +0100 Message-ID: Subject: Re: Syntax question using (identifier 1, identifier 2) on LHS of = To: users@groovy.apache.org Content-Type: text/plain; charset=UTF-8 archived-at: Fri, 27 Jan 2017 18:56:23 -0000 On 27 January 2017 at 19:15, Les Hartzman wrote: > Hi, > > I just saw a reference to using the above syntax, specifically as follows: > > def (string1, string2) = "part1-part2".tokenize("-") > > This assigns string1 "part1" and string2 "part2". > > So my main question is what is this referred to as? It's called multiple assignment. > > You can't do: > > String (string1, string2) = "part1-part2".tokenize("-") Well, you couldn't. What if types were different? But you could do it like this: def (String string1, String string2) = "part1-part2".tokenize("-") More on multiple assignments here: http://groovy-lang.org/semantics.html#_multiple_assignment Cheers, Dinko > > I did find out that you can do: > > String string1 > String string2 > (string1, string2) = "part1-part2".tokenize("-") > > Thanks. > > Les >