From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by sourceware.org (Postfix) with ESMTPS id 41A4D3851C36 for ; Mon, 1 Jun 2020 18:16:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 41A4D3851C36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=j.r.hope@gmail.com Received: by mail-ej1-f53.google.com with SMTP id e2so10081075eje.13 for ; Mon, 01 Jun 2020 11:16:12 -0700 (PDT) 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=e0G6f81n5eXrvY0L6D5b+2HxAo9nsgVXaKhIayyMZm8=; b=tlg849XSrkWPUcc8/En3vJsscX5Cs7yPRHHb0r74ih+stRnWcIoenEPqtfwVfAjDJp fkZn+PS2EQu7x9+PxhE6PWz+7LqkmiIPqjVbLSl12IS7ZVhiQPlOaLbwyrfLbmjFNo6t bIvMpA7XVFWWYFbZJPDJNm9k7LwHK8+USYZqVC02ss+odfC2srjg1K0b00dMzUaNdQo5 Rt+yn5aooZjk/gA0YcYO0ij9KgpD1Exm3lwpXrrEVDIksS2vCPGvIALBYlk5A2w3okP1 NPhR2m++H0WxjQ6hkY9FFa7yUUJqRuYSK47ZJMOFrLR0NuV1bJQ3L7k9j1LdQs59stb7 4czw== X-Gm-Message-State: AOAM532HjLKX2CEKhK4NgrVFEGX8dyChgduJfJQhL6HVevSOfmGoVI2j AYWNxp5bP+EgPzepOnjW6EGj/+57+uK4j2q7tCCuAw== X-Google-Smtp-Source: ABdhPJwGvM1dSKuMgk5EwhsrBYQLTiiDe3+q0gkY14QT6zHSoObQvIz1Aa3s9sK+Ed1WVkWRfmkSK81AV5nPnwXKLx0= X-Received: by 2002:a17:906:7c82:: with SMTP id w2mr19548232ejo.296.1591035370843; Mon, 01 Jun 2020 11:16:10 -0700 (PDT) MIME-Version: 1.0 From: Jamison Hope Date: Mon, 1 Jun 2020 14:16:00 -0400 Message-ID: Subject: define-simple-class fields with ConstantValue attribute? To: kawa@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 18:16:13 -0000 Is there a field initialization syntax for define-simple-class which will cause the field to have a ConstantValue attribute set? For example, if Test.java contains: public class Test { public static final int X = 3; } then Test.class will have: Field name: X public static final Signature: int Attribute "ConstantValue", length:2, value: Integer 3 However, the equivalent (I believe) Kawa: (define-simple-class Test () (X ::int allocation: 'static access: 'final init-form: 3)) produces: Field name: X public static final Signature: int without the ConstantValue attribute, and instead fills in the value via code in clinit: Method name:"" public static Signature: ()void Attribute "Code", length:29, max_stack:1, max_locals:0, code_length:5 0: iconst_3 1: putstatic 4: return I also tried init: and init-value: and they didn't make a difference. Thanks, -- Jamison Hope