From dev-return-4185-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Fri Feb 9 17:07:00 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 4309B180654 for ; Fri, 9 Feb 2018 17:07:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 32438160C4C; Fri, 9 Feb 2018 16:07:00 +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 295E2160C2E for ; Fri, 9 Feb 2018 17:06:59 +0100 (CET) Received: (qmail 27692 invoked by uid 500); 9 Feb 2018 16:06:58 -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 27682 invoked by uid 99); 9 Feb 2018 16:06:57 -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, 09 Feb 2018 16:06:57 +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 1E51A1801AD for ; Fri, 9 Feb 2018 16:06:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.979 X-Spam-Level: * X-Spam-Status: No, score=1.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=jalbum-net.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Y3E0reap9KJB for ; Fri, 9 Feb 2018 16:06:54 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BACB95F1A1 for ; Fri, 9 Feb 2018 16:06:53 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id u20so9689008lff.11 for ; Fri, 09 Feb 2018 08:06:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jalbum-net.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=mK9YbGo8eq8bgYwIQCUnnCzm8CIPIFkePN9KhyZoRzI=; b=xUZIgjR3EfGw8GyDCogieXrXkD1K7YX1947qAwZnExGPvta+m/Ff8c5gi0f/7cIyIv Hn5MlSNUMjKbnJ91dRr6PpYGQ9AS1IIwbxS/AD4MeXqlfR2Rc92ObQfHcCtSTQMbAXzS B6PEKTbgwG/7pUKp4J9uNvv51kEKZlXVWYU+kZnDxgARsUbruSbZatXNOLPDhXD3cV9i IMX+twUBnoyM44ylWhN5pi82608WkmBkYqI871ShfLL9CGKbYL7gQYD8aao5nbPdFoKH vW5QEkI7Z+7r+i0R7/W76XOwiHaenJUXDs66m9a5sKdtCcGhX+VQ5tcWeBQegMhYxENL R6iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=mK9YbGo8eq8bgYwIQCUnnCzm8CIPIFkePN9KhyZoRzI=; b=HJ6Jq3gIYfix3TDSTQZbGTv/isER24FtaLulcpsaLqS5Wny3GZ9ijcVLl6GMdmlTsh 8mwNHrD6NJT3CRwSgsSIMPcFKo2CbM7tdDPe5BM233HlWPiqPmbkUgjH65gPZCbsp51K j+GF3vbomDfKWLrog0wYo2MS/zSNoV/TFUPfDbF/CyW3EDBK5Gq2lVQH3DPp4v4CMe89 t7FyW5O9Pby7YUJZmsAMx5cdZdmsr3CdQMnMadBBjfMfXZILhG5HHcHQvkwaDQncTGju tWZQXMfhdmIxCX7jY95bCGtx2Ex2GX+zNmTxQ3YPfwMbRiwqeC8DhtISeHu65pEdim7A hmyw== X-Gm-Message-State: APf1xPCCoRNXAHgat6NCHIyyOs1kKclAxxqBf+T4i4VjtzRep4/vpCdV jFrLqJASSanxlJdS0QR9Wlg/TUtYLmw= X-Google-Smtp-Source: AH8x225LaCqfQKfM+Uo6ZOf2QULDGT2AHIzSCfeqmvoOIeU8T+JA09EoQ797w+0nnmYN0WD/i7pbwA== X-Received: by 10.46.91.80 with SMTP id p77mr300861ljb.122.1518192412787; Fri, 09 Feb 2018 08:06:52 -0800 (PST) Received: from davids-mbp-2.lan (c-479fe555.029-352-73746f44.cust.bredbandsbolaget.se. [85.229.159.71]) by smtp.gmail.com with ESMTPSA id a2sm477990ljb.88.2018.02.09.08.06.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 08:06:51 -0800 (PST) From: David Ekholm Content-Type: multipart/alternative; boundary="Apple-Mail=_984E4889-4369-41A2-85DF-B5A197793B3F" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Remembering imports between script invocations Date: Fri, 9 Feb 2018 17:06:52 +0100 References: <2BA8478A2FBAFF4FBFDF1724FAD8C09E901F097C@C111BKGPMBX48.ERF.thomson.com> <2BA8478A2FBAFF4FBFDF1724FAD8C09E901F09B8@C111BKGPMBX48.ERF.thomson.com> To: dev@groovy.apache.org In-Reply-To: <2BA8478A2FBAFF4FBFDF1724FAD8C09E901F09B8@C111BKGPMBX48.ERF.thomson.com> Message-Id: <5C41FF9C-3EE3-47E2-9F30-1D4B14798DCD@jalbum.net> X-Mailer: Apple Mail (2.3273) --Apple-Mail=_984E4889-4369-41A2-85DF-B5A197793B3F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Who can I contact? Regards /David > On 8 Feb 2018, at 23:25, = wrote: >=20 > Sounds more like the Groovy Shell or Groovy Console. Not too sure = myself how the javax.script stuff is tied in. > =20 > From: David Ekholm [mailto:david@jalbum.net ]=20= > Sent: Thursday, February 08, 2018 2:47 PM > To: dev@groovy.apache.org > Subject: Re: Remembering imports between script invocations > =20 > How do I do that via the javax.script API? > =20 > Even if this is possible via the javax.script API, chances are that a = user wishes to ad-hoc add another import, but as they are forgotten = between script invocations, it makes it hard to use Groovy to = interactively create, say a Swing or JavaFX UI one line at a time. With = BeanShell, the user can add the needed imports, execute that "script" = and then continue to refer to the imported classes in the following = script invocations. Making Groovy remember imports would make it behave = in as nice fashion as the new JShell tool in Java 9. JShell = unfortunately cannot run embedded via the javax.script API :-( > =20 > Regards > /David > =20 > On 8 Feb 2018, at 21:34, eric.milles@thomsonreuters.com = wrote: > =20 > You can add all the imports you want to your compiler configuration = and they will be consistently available for all scripts. > =20 > From: David Ekholm [mailto:david@jalbum.net ]=20= > Sent: Thursday, February 08, 2018 2:12 PM > To: dev@groovy.apache.org > Subject: Remembering imports between script invocations=20 > =20 > We're considering supporting Groovy as an additional scripting = language to our web gallery software jAlbum (http://jalbum.net = ), but one aspect = bugs me: It doesn't seem like import statements are remembered between = script invocations. This makes it far harder to use Groovy to prototype = UIs within jAlbum's scripting console than for instance BeanShell (using = the javax.script API). We currently support the slow BeanShell scripting = language and JavaScript. BeanShell behaves well in this regard, = remembering earlier imported packages between script invocations. Can = this be added to Groovy or is there some API flag we can set? > =20 > Regards > /David, jAlbum founder and client lead developer. --Apple-Mail=_984E4889-4369-41A2-85DF-B5A197793B3F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Who can I contact?

Regards
/David


Sounds more like the = Groovy Shell or Groovy Console.  Not too sure myself how the = javax.script stuff is tied in.
 
From: David Ekholm [mailto:david@jalbum.net] 
Sent: Thursday, February 08, 2018 = 2:47 PM
To: dev@groovy.apache.org
Subject: Re: Remembering imports = between script invocations
 
How do I do that via the javax.script API?
 
Even if this is possible via the = javax.script API, chances are that a user wishes to ad-hoc add another = import, but as they are forgotten between script invocations, it makes = it hard to use Groovy to interactively create, say a Swing or JavaFX UI = one line at a time. With BeanShell, the user can add the needed imports, = execute that "script" and then continue to refer to the imported classes = in the following script invocations. Making Groovy remember imports = would make it behave in as nice fashion as the new JShell tool in Java = 9. JShell unfortunately cannot run embedded via the javax.script API = :-(
 
Regards
/David
 
On 8 = Feb 2018, at 21:34, eric.milles@thomsonreuters.com wrote:
 
You= can add all the imports you want to your compiler configuration and = they will be consistently available for all scripts.
 
From: David Ekholm [mailto:david@jalbum.net] 
Sent: Thursday, February 08, 2018 = 2:12 PM
To: dev@groovy.apache.org
Subject: Remembering imports between = script invocations 
 
We're considering supporting Groovy as an additional = scripting language to our web gallery software jAlbum (http://jalbum.net), but one aspect bugs me: It = doesn't seem like import statements are remembered between script = invocations. This makes it far harder to use Groovy to prototype UIs = within jAlbum's scripting console than for instance BeanShell (using the = javax.script API). We currently support the slow BeanShell scripting = language and JavaScript. BeanShell behaves well in this regard, = remembering earlier imported packages between script invocations. Can = this be added to Groovy or is there some API flag we can set?
 
Regards
/David, jAlbum founder and client lead = developer.

= --Apple-Mail=_984E4889-4369-41A2-85DF-B5A197793B3F--