From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46543 invoked by alias); 27 Sep 2017 15:35:20 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 46531 invoked by uid 89); 27 Sep 2017 15:35:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*M:squirrel, H*u:SquirrelMail, H*UA:SquirrelMail, H*r:SquirrelMail X-HELO: mail.theptrgroup.com Received: from mail.theptrgroup.com (HELO mail.theptrgroup.com) (71.178.251.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Sep 2017 15:35:13 +0000 Received: from mail.theptrgroup.com (localhost [127.0.0.1]) by mail.theptrgroup.com (Postfix) with ESMTP id E064840223 for ; Wed, 27 Sep 2017 11:35:11 -0400 (EDT) Received: from 108.48.102.104 (SquirrelMail authenticated user jrh) by mail.theptrgroup.com with HTTP; Wed, 27 Sep 2017 11:35:11 -0400 Message-ID: <0e171db2826d56c03486540fe4ae7f2f.squirrel@mail.theptrgroup.com> In-Reply-To: <9f5b2403-5086-f623-f031-ca159889b3a5@bothner.com> References: <87mv5gry11.fsf@nexoid.at> <9f5b2403-5086-f623-f031-ca159889b3a5@bothner.com> Date: Wed, 27 Sep 2017 15:35:00 -0000 Subject: Re: Reflection From: "Jamison Hope" To: "kawa mailing list" Reply-To: jrh@theptrgroup.com User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00085.txt.bz2 On Wed, September 27, 2017 11:28 am, Per Bothner wrote: > On 09/27/2017 07:55 AM, Peter wrote: >> I'm trying to reflect on Classes, however, I'm running into some >> problems: >> >>> ("foo":getClass) >> class java.lang.String >>> (("foo":getClass):getCanonicalName) >> ; Evaluation aborted on java.lang.RuntimeException: no applicable method >> named `getCanonicalName' in java.lang.String. >>> (java.lang.String:getCanonicalName) >> ; Evaluation aborted on java.lang.RuntimeException: no such field >> getCanonicalName in java.lang.String. >>> (:getCanonicalName) >> ; Evaluation aborted on java.lang.RuntimeException: no such field >> getCanonicalName in java.lang.String. > > This is explained in > https://www.gnu.org/software/kawa/Colon-notation.html > > However, that doesn't say what to do instead. (I'm adding a note for > that.) > > Basically, if the "receiver" (this) argument is a Class then you can't use > colon notation, but you can use the invoke procedure: > > (invoke ("foo":getClass) 'getCanonicalName) Using "*:" notation works, too: (*:getCanonicalName ("foo":getClass)) -- Jamison Hope jrh@theptrgroup.com