Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ADC6F18CE6 for ; Thu, 4 Feb 2016 09:10:53 +0000 (UTC) Received: (qmail 81618 invoked by uid 500); 4 Feb 2016 09:10:53 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 81581 invoked by uid 500); 4 Feb 2016 09:10:53 -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 81571 invoked by uid 99); 4 Feb 2016 09:10:53 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 09:10:53 +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 032D718052A for ; Thu, 4 Feb 2016 09:10:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.77 X-Spam-Level: X-Spam-Status: No, score=0.77 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.429, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id p1Tl1VQb_LLO for ; Thu, 4 Feb 2016 09:10:50 +0000 (UTC) Received: from nm12-vm1.bullet.mail.bf1.yahoo.com (nm12-vm1.bullet.mail.bf1.yahoo.com [98.139.213.38]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id B3C7631AD0 for ; Thu, 4 Feb 2016 09:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1454577042; bh=PgC/39LCNF3ICKef3xQBGF2D3AFZrXJ+J977fQNdbVw=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=h5uhKOojmqNZX1m5ffQ7aNS22rixv1I61UfgFjWH9VaFfJSgLuuZr7rtLEKzoPqPwD1Kk+vJ0RQlKV9SyBjij6ar3Dwxxwgul1AeyuRuu8ysEvBi0YX+fx2hH4jrZPKrypXegJeiLpltStnprEBcVvV7tphCiIJ1BH8iWnepe6b5pfIfFjRvLq1OQVQl4MZLpGrncDSlMBuh0cRHUqoRviGD1RMV59+SNnnzojS9DkJJYly5HNGsvAowQRwBB9rCE0ULt9Fn0+lkcMUx0t3qtT10SUmaoG3XC0mHTTwX4Ft/bH9PGjtjaQGnCoDdSG+796/B2lNPJxiIKALiRoE4LQ== Received: from [66.196.81.170] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 04 Feb 2016 09:10:42 -0000 Received: from [98.139.212.196] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 04 Feb 2016 09:10:42 -0000 Received: from [127.0.0.1] by omp1005.mail.bf1.yahoo.com with NNFMP; 04 Feb 2016 09:10:42 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 693697.41260.bm@omp1005.mail.bf1.yahoo.com X-YMail-OSG: 3_NFQMAVM1lAVCGP9J4FglDTwxsJCcill5ieRGuILlU.u_RpPR13Dtp6LMzDW5R Xhd19F2mT2L2rss8eUFvN2iTgNTWV64kfSdc0bEBEyuK66tfmwhzjtirEwlgq8V56vpbZveH4nTb 6M2AiBr0KHJpQmqvM6vLviZKJF.i0OdFfqesYPjY.INFs3lVY2YB3fMsf6PYjj.mkRmBg82Lg82r seWnotX5rZYegQwbmqwwPsmBtB.aArNf8QZLCqXsWy5SPkFZGhP4hfcjMkVprmjJSmkkuklmnw0J v_d5CwL_Tt5iq3vnF4PGpjgCAuNRU3s6nWp1vFZFWvNfBXBAHFuhDSOeNqplNfMJqUHAI5tY0CN4 cugAOabOieAcCIIOVzWq7LErHa6LUhkTLPXHPqyA_3.SCr7U5vMn5ID6m2_O_pqsziIl9X.m8ijZ u4u2jrCgw5ShLmgzELg_8CC070nsY6gK4xdS2wsFaknYXqdNXlj02BB2V8JHWOcrutSgf3bQ0jB4 UMXzYPTZDgyx2 Received: by 66.196.80.144; Thu, 04 Feb 2016 09:10:42 +0000 Date: Thu, 4 Feb 2016 09:10:32 +0000 (UTC) From: Anton Sarov Reply-To: Anton Sarov To: "users@groovy.apache.org" Message-ID: <6826371.1739930.1454577032067.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <56B2746D.1090701@gmx.net> References: <56B2746D.1090701@gmx.net> Subject: Re: GroovyShell Binding with TypeChecked MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1739929_434871702.1454577032063" ------=_Part_1739929_434871702.1454577032063 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Pascal, I realize that the binding is just a map but I still do not see the implication. The type checker could very well take the variable name - in my case "util" and look it up in the map/binding - just to see if there is such a key. Now I am having the feeling that the type checker does not use the binding/map at all. Am I correct? Best regardsAnton On Wednesday, February 3, 2016 10:43 PM, Pascal Schumacher wrote: Hi Anton, Binding is essentially just a map. The typ checker does not know which values will be present. Therefore it flags "util" as undeclared. Cheers, Pascal Am 03.02.2016 um 16:24 schrieb Anton Sarov: Hello, I have the following case where I want to make use of the type checking feature: http://groovyconsole.appspot.com/script/5121843795066880 Unfortunately I get an error like: "The variable [util] is undeclared". Why is this happening? I defined a variable in the provided binding but apparently this is somehow not relevant to the Groovy Shell... Best regards Anton startup failed: Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared. @ line 7, column 17. def a = util.test(); ^ 1 error startup failed: Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared. @ line 7, column 17. def a = util.test(); ^ 1 error startup failed: Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared. @ line 7, column 17. def a = util.test(); ^ 1 errorstartup failed: Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared. @ line 7, column 17. def a = util.test(); ^ 1 error startup failed: Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared. @ line 7, column 17. def a = util.test(); ^ 1 error ------=_Part_1739929_434871702.1454577032063 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Pascal,

I realize that the binding is ju= st a map but I still do not see the implication. The type checker could ver= y well take the variable name - in my case "util" and look it up in the map= /binding - just to see if there is such a key.

Now I am having the feeling that the type ch= ecker does not use the binding/map at all. Am I correct?

Best regards
Anton


On Wednesd= ay, February 3, 2016 10:43 PM, Pascal Schumacher <pascalschumacher@gmx.n= et> wrote:


Hi Anton,

Binding is essentially just a map. The typ checker does not know which values will be present. Therefore it flags "util" as undeclared.

Cheers,
Pascal

Am 03.02.2016 um 16:24 schrieb Anton Sarov:
Hello,

I have the following case where I want to make use of the type checking feature:

http://groovyconsole.appspot.com= /script/5121843795066880


Unfortunately I get an error like: "The variable [util] is undeclared".

Why is this happening? I defined a variable in the provided binding but apparently this is somehow not relevant to the Groovy Shell...

Best regards
Anton
startup failed:
Script1.groovy: 7: [Static type checking] - The variable [util] is undeclar=
ed.
 @ line 7, column 17.
           def a =3D util.test();
                   ^

1 error
startup failed:
Script1.groovy: 7: [Static type checking] - The variable [util] is undeclar=
ed.
 @ line 7, column 17.
           def a =3D util.test();
                   ^

1 error
startup failed:
Script1.groovy: 7: [Static type checking] - The variable [util] is undeclar=
ed.
 @ line 7, column 17.
           def a =3D util.test();
                   ^

1 errorstartup failed:
Script1.groovy: 7: [Static type checking] - The variable [util] is undeclar=
ed.
 @ line 7, column 17.
           def a =3D util.test();
                   ^

1 error
startup failed:
Script1.groovy: 7: [Static type checking] - The variable [util] is undeclar=
ed.
 @ line 7, column 17.
           def a =3D util.test();
                   ^

1 error



------=_Part_1739929_434871702.1454577032063--