From dev-return-5008-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sat Jun 2 13:24:40 2018 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 72A36180609 for ; Sat, 2 Jun 2018 13:24:39 +0200 (CEST) Received: (qmail 60609 invoked by uid 500); 2 Jun 2018 11:24:38 -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 60599 invoked by uid 99); 2 Jun 2018 11:24:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2018 11:24:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6F572C0358 for ; Sat, 2 Jun 2018 11:24:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.97 X-Spam-Level: * X-Spam-Status: No, score=1.97 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, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=asert-com-au.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 6fppfS5VmEzE for ; Sat, 2 Jun 2018 11:24:36 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 2FBF75F19C for ; Sat, 2 Jun 2018 11:24:35 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id 14-v6so16625304oie.3 for ; Sat, 02 Jun 2018 04:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asert-com-au.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=On0w07q0uif3rGimX7eieYX6lUToH3Bjqy/jD/ZMG+0=; b=FD2+3UFK5lmjI3fIKjnb5xIE4fzmFye/1Riur/mcLln0LOBxCt2uhPH4Ai6f4e8pN5 /MSZJMMBzGIz7A7Dcs/4NMonfuKEkLzNQ2W0LdDjiFoG6hbwzyNGWagagNVKL5f1kNeD vz/pC50gQeyGpzLh4mA8nsNrxC7ahOMN/h6GxqRz4hFMSnV3fyaYU6JdplswB1YguXtO v4FzXKRypn4ZETzH9AgOnXRpmT6lUCNAwulptdLQWYY5Bphrn5PgID2FcvnOSLgv5+Qb wUzAoawKIGChHYkmC2P4SlkN2E8EzdqCDD4CRImX6CN6IPWruEe+2NVsZfBLN2KG2hsZ LzaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=On0w07q0uif3rGimX7eieYX6lUToH3Bjqy/jD/ZMG+0=; b=ilxJLgQTG5sv6y2ool8wk6e8fxCZueXG9lllD+0QS//J4+OdYgA7RqwzjBAd69hZzd Nl8kAMzPrK52n7o2R/28WeoCLC6k0UF5A5ToIsooKCHXmzpprVvz7BwEqtACbjjbrUVt u4KChLyyqkdYYLDcZ6YvjKO+tkUufmzA1B/LI8N5svXSw707BjZDUw3RhDXsAptv4yEL eXJ+5f/0dTBQ622Dl8fcxO2/ZizXNNRkbXApUROmgZaNZUbFwp3+h+VhxeZXYBgVQG/e yTBivhTZrqOa8Sw8qjek/KiBt7wABfAC6VZb68gyE+WI2k9ebxpekwnneMJpi3ejdhJW QYZg== X-Gm-Message-State: APt69E0+n1imWOYRWYqOIJRy/wQfDCXHkuKkjzt4amDHDcwyaArKWX1q T9aUP7WfezqO3wSqpFvZqmNozwvRGZjsoshDiMK+Sg== X-Google-Smtp-Source: ADUXVKJJXupdctlzE1FNIxxy3pxtcEDZp5Tk26TxhFNTFyImu7jL/BcSreDWZSvv5dNgnV3amFhaga06wDrzTQHFRho= X-Received: by 2002:aca:d906:: with SMTP id q6-v6mr7715413oig.349.1527938667788; Sat, 02 Jun 2018 04:24:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: paulk@asert.com.au From: Paul King Date: Sat, 2 Jun 2018 13:24:15 +0200 Message-ID: Subject: Re: question on AST transformations To: dev@groovy.apache.org Content-Type: multipart/alternative; boundary="000000000000885afd056da6f152" --000000000000885afd056da6f152 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm on holidays and can't really check right now but I wouldn't necessarily assume a compilation error. On Fri., 1 Jun. 2018, 7:25 pm josedeoliveiraguimaraes@gmail.com, < josedeoliveiraguimaraes@gmail.com> wrote: > Thanks a lot, Paul. That will be very helpful in the second article I am > preparing on the Metaobject Protocol of language Cyan. The first article = is > available in http://cyan-lang.org/articles/. By the way, it cites your > Groovy book. > > One more question: suppose an AST transformation class inserts a method > and a field in a class 'HelpMe'. That is made in the SEMANTIC_ANALYSIS > phase (maybe another phase, I think it does not matter). Another class > 'Other' accesses the inserted field and call the inserted method of > 'HelpMe'. Annotation @CompileStatic is attached to 'Other'. Assume that t= he > semantic analysis of 'Other' is made before that of 'HelpMe' (I am assumi= ng > there is no pre-defined compilation order between the source files, then = it > could be 'HelpMe' before 'Other' but the problem that follows should not > happen in this case). That will cause a compile error because the field a= nd > method will not be found in 'HelpMe'. Is that correct? > > Cheers, Jos=C3=A9 > --000000000000885afd056da6f152 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm on holidays and can't really check right now = but I wouldn't necessarily assume a compilation error.

Thanks a lot, Paul. That will be very helpful in the second article I= am preparing on the Metaobject Protocol of language Cyan. The first articl= e is available in http://cyan-lang.org/articles/. By th= e way, it cites your Groovy book.

One more question: suppose an AST transformation class inserts a method and= a field in a class 'HelpMe'. That is made in the SEMANTIC_ANALYSIS= phase (maybe another phase, I think it does not matter). Another class = 9;Other' accesses the inserted field and call the inserted method of &#= 39;HelpMe'. Annotation @CompileStatic is attached to 'Other'. A= ssume that the semantic analysis of 'Other' is made before that of = 'HelpMe' (I am assuming there is no pre-defined compilation order b= etween the source files, then it could be 'HelpMe' before 'Othe= r' but the problem that follows should not happen in this case). That w= ill cause a compile error because the field and method will not be found in= 'HelpMe'. Is that correct?

Cheers, Jos=C3=A9
--000000000000885afd056da6f152--