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 57425200C8C for ; Tue, 23 May 2017 03:34:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 55F13160BD4; Tue, 23 May 2017 01:34:10 +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 9BDC1160BBF for ; Tue, 23 May 2017 03:34:09 +0200 (CEST) Received: (qmail 23880 invoked by uid 500); 23 May 2017 01:34:08 -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 23870 invoked by uid 99); 23 May 2017 01:34:08 -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; Tue, 23 May 2017 01:34:08 +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 0E756CD2CA for ; Tue, 23 May 2017 01:34:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.38 X-Spam-Level: X-Spam-Status: No, score=0.38 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, 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-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 0f-6XOS_t1ko for ; Tue, 23 May 2017 01:34:04 +0000 (UTC) Received: from mail-ua0-f194.google.com (mail-ua0-f194.google.com [209.85.217.194]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6FDD65F20C for ; Tue, 23 May 2017 01:34:04 +0000 (UTC) Received: by mail-ua0-f194.google.com with SMTP id j17so8949719uag.1 for ; Mon, 22 May 2017 18:34:04 -0700 (PDT) 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=QNO22dxWp1OGLAGy+/ivZq4Ekw6LNWPqUytxv6BEYE8=; b=O5cw+6RpRjb+L7+BMpmOBPTaBvLau+aU6pm5j9gxnD6+G9JhXoFagbaQWCmYY2HoV3 GnA6PJUUagAbDJ89G43Tpn2yKrbwFUK4Vw/Btpqy3+1iqUKs0xjgYRy86IPkX6/Z35Sx i+VNyjcdVMXcNZVGhj4b0xKFUbNkGA8SsB7sUkUFxEUpkFPVctiAwel4TJypRxR1Jt31 WRt+qTW9aRAsXSRLRM+mdLvkmjCMHyFxoHiELjZIGJgqYekU4B8QLYsLdb6ytbyGC4pF OL4f15ayBzHAtNXMP+7DYUS0yP831lE+nK4/eO3PTfOr/OXNXew+IqCg5VFiAzriQVt2 4vOQ== 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=QNO22dxWp1OGLAGy+/ivZq4Ekw6LNWPqUytxv6BEYE8=; b=iqlGVJA/gc8mWj+y0zA21/k4tqvlVdcWhEF2mk6MBLQvcmIoM0+w8Ugk21bzvZq2sy oLKuRgdnwwM2AeBUw9KoB3CH6G3SByUSDA1aWWWy/a/xL8pk1YLAX/WDBUbDh6VoP2+S TCsyLJJttPn2ybe+q9nwLCaBiXn1R/qgoR+G/prxnsSVXEZZoN2ln24FkZezB1lD+Uud siUYCSVxzVFftJ+B4LL3kkvEkgMJuqXQxqC6zNxOZkgzoUF6nsWBjasxsVwtLTjuzU/v ptP7vYzJdGdtX7wk7KAaQA6olKzdBeyK3IF6xGT93ToL8R9myn+cXyjaFAt8lldNpZYv m5UA== X-Gm-Message-State: AODbwcBspBq7pD2vXYFlbdjdY8YAsh2s4BYhqfgvMv4XOWMCfK/wYKzI ihJ5XW6QmVUQQQ3SrrhG3Z2lv0jebdHN X-Received: by 10.176.3.231 with SMTP id 94mr13851631uau.124.1495503243760; Mon, 22 May 2017 18:34:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.65.68 with HTTP; Mon, 22 May 2017 18:34:03 -0700 (PDT) In-Reply-To: <592278B9.7070600@gmx.org> References: <592278B9.7070600@gmx.org> From: Assia Alexandrova Date: Mon, 22 May 2017 21:34:03 -0400 Message-ID: Subject: Re: JSR 223 support behavior To: users@groovy.apache.org Content-Type: text/plain; charset="UTF-8" archived-at: Tue, 23 May 2017 01:34:10 -0000 Hi, Thanks for the prompt response! I am a bit confused. According to what appears to be the official language semantics: http://www.groovy-lang.org/semantics.html#_variable_definition the 'def' keyword is used to declare an untyped variable (i.e. one whose type is Object). So something like def x = 10 is then presumably equivalent to two separate statements: def x x = 10 What is the difference in semantics between 'def x = 10' and 'x = 10'? Can you point me to how docs where I can learn about transforms and write such a transform? I'd like to understand if this behaviors is some side-effect of the implementation of the language or really designed following some rationale. In the latter case, cool, but in the former, I'd take a stab at a writing a transform. The following REPL interaction seems too strange to me :-) groovy:000> def x = 10; ===> 10 groovy:000> x Unknown property: x Regards On Mon, May 22, 2017 at 1:35 AM, Jochen Theodorou wrote: > > On 22.05.2017 06:53, Assia Alexandrova wrote: >> >> Hi all, >> >> My first time here. I wasn't sure weather to post this to dev list, so >> please let me know if I should! >> >> I'm trying to hook the latest Groovy interpreter to a JVM scripting >> notebook environment (https://github.com/bolerio/seco). At a minimum I >> need good JSR 223 support so that symbols/variables can be shared >> between scripting languages. With Groovy and its built-in JSR 223 >> support, it seems like an assignment: >> >> something = 10 >> >> is placed into the common scripting context, but not a definition like this: >> >> def something = 10 > > > that is by language design > > > [...] >> >> Is this a bug? If not, is there a way to get access to those symbols >> introduced via 'def'. Disclaimer: I'm not a Groovy programmer, just >> trying to learn enough to make this work. > > > you could write a transform to rewrite the code for those. > > But why not simply use it without def? > > bye Jochen >