From users-return-3975-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Wed Mar 20 22:23:46 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A8FB718062C for ; Wed, 20 Mar 2019 23:23:45 +0100 (CET) Received: (qmail 92952 invoked by uid 500); 20 Mar 2019 22:23:44 -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 92942 invoked by uid 99); 20 Mar 2019 22:23:44 -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, 20 Mar 2019 22:23:44 +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 3567DC0F7F for ; Wed, 20 Mar 2019 22:23:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.549 X-Spam-Level: ** X-Spam-Status: No, score=2.549 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7cMPb9uGKzyQ for ; Wed, 20 Mar 2019 22:23:42 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id CC2F6624AA for ; Wed, 20 Mar 2019 22:23:41 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id v10so3577498iom.8 for ; Wed, 20 Mar 2019 15:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+HUE/l1ZBhKIDnp4PVowQ3ID2Y+xp1iqeN3C8oJOz10=; b=Kdciu2HKJ3mtTYxm992ogzK9rlqM62SH8nMnhXeUl82o0jSvNXOkktAm9B9omSlXrB rOQ+Jkt49Wc2c2fZHolJOeeo04nyciDVpC/3WSZo1Oaocoo6TlMoH8thrYx+3/GOWLSV D3EhY/5uEN6ZGOMfwc0NdL9OaOqvVvt/As0NxLuvAM+pP+uoRAqU4waMVREvhkgz4f4f 8jxXOEJwlkSG4aXJLA7OEGWGuebWWiAsPD0D1sJtdRwjyOa+kDpevLjL18jBnUE03rWj FPdtBcuvr8+SMOUBzfZgKAn7W3MJsc1KskUBZfIxbsmJRGBad9ycP9Zrjhlz+kattCT8 lYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+HUE/l1ZBhKIDnp4PVowQ3ID2Y+xp1iqeN3C8oJOz10=; b=HSqbKmmQjEvqmQ/sEnaG+vrV7RffhCiLQrs1DT7XcOaaaDGmUOUHfi48GgV2Dbk8HL rwOFcsbtt3rdLwOtJQreaIJwJd/11YUsX5e9XbFmF5X9XXKQ3YKE7DMZZ1dgDdQueH4x kZ8C+5fsl74sniVNFnrgtJAsgZtRSOapjs1wX00oW/BjSFuIJSl+ow7JhlwFjL5cCSKL HwibF5ehgvoAO0cgimdZ2Sxd9VorJfU2if5V2OJt2OngXWry/67XxjCKy8MgdoTUU+hI j6vEovNpa6HUxQupNcSdbh28P/Gdu6UQr1cbFQpbD1OrN58U0/WCNpuTGIlMMA1uAQd0 DETA== X-Gm-Message-State: APjAAAUG+KgFKuf271WOQ9ngVuiezSmJ9sL89kYoEvLa80IZZTHGoPyA 67eE5IKjJj7CqS9r3hbUB7H8BUvJMif+rs2Sgogc6V+k X-Google-Smtp-Source: APXvYqwRpjNgo7jOl3P4aZhen8GM5S4jsGaVTmftHSQ0HHdXXtY0dI0En42899+QDaEuzfiB3a6YuG98GqWFRcSoyPM= X-Received: by 2002:a5e:8c0b:: with SMTP id n11mr375229ioj.265.1553120615025; Wed, 20 Mar 2019 15:23:35 -0700 (PDT) MIME-Version: 1.0 From: Narahari Lakshminarayana Date: Wed, 20 Mar 2019 18:23:23 -0400 Message-ID: Subject: groovyscript and binding, what is wrong in this code To: users@groovy.apache.org Content-Type: multipart/alternative; boundary="0000000000008d51b505848e12be" --0000000000008d51b505848e12be Content-Type: text/plain; charset="UTF-8" Friends: Thank you in advance for your help. I have the following groovyscript code. def zebra_test1_list = [ "zebra1", "zebra2" ] def zebra_test2_list = [ "zebra3", "zebra4" ] def data="test1" def zebra = groovy.util.Eval.me("zebra_${data}_list") println zebra I get the error groovy> def zebra_test1_list = [ "zebra1", "zebra2" ] groovy> def zebra_test2_list = [ "zebra3", "zebra4" ] groovy> def data="test1" groovy> def zebra = groovy.util.Eval.me("zebra_${data}_list") groovy> println zebra Exception thrown groovy.lang.MissingPropertyException: No such property: zebra_test1_list for class: Script1 at Script1.run(Script1.groovy:1) at ConsoleScript2.run(ConsoleScript2:5) Please help as to what I might be doing wrong. -N --0000000000008d51b505848e12be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Friends:

Thank yo= u in advance for your help.

I have the following groovys= cript code.

def zebra_test1_list =3D [ "zebra1", "zebra2" ]
def zebra_test2_list =3D [= "zebra3", "zebra4" ]

def data=3D"test1"
def zebra =3D groovy.util.= Eval.me("zebra_${data}_list")

println zebra


I g= et the error

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

groovy> def zebra_test1_list =3D [ "zebra1", &quo= t;zebra2" ]=C2=A0
groovy> def zebra_test2_list =3D [ &quo= t;zebra3", "zebra4" ]=C2=A0
groovy> def data=3D= "test1"=C2=A0
groovy> def zebra =3D groovy.util.Eval.me("zebra_${data}_list&quo= t;)=C2=A0
groovy> println zebra=C2=A0
=C2=A0
Exception thrown

groovy.lang.MissingPropertyExc= eption: No such property: zebra_test1_list for class: Script1
at Script1.run(Script1.groovy:1)
=
at ConsoleScript2.run(ConsoleS= cript2:5)


Please help as to w= hat I might be doing wrong.

-N
--0000000000008d51b505848e12be--