From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11544 invoked by alias); 27 Sep 2017 15:29:41 -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 11534 invoked by uid 89); 27 Sep 2017 15:29:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:5086 X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Sep 2017 15:29:39 +0000 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dxEHH-0005BE-GH; Wed, 27 Sep 2017 17:29:35 +0200 Received: from 64-118-125-12-rt-broadband.broadband.oakhurst.sti.net ([64.118.125.12] helo=localhost.localdomain) by mailfront10.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1dxEGb-0007SV-29; Wed, 27 Sep 2017 17:28:53 +0200 Subject: Re: Reflection To: Peter , kawa mailing list References: <87mv5gry11.fsf@nexoid.at> From: Per Bothner Message-ID: <9f5b2403-5086-f623-f031-ca159889b3a5@bothner.com> Date: Wed, 27 Sep 2017 15:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <87mv5gry11.fsf@nexoid.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00084.txt.bz2 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) -- --Per Bothner per@bothner.com http://per.bothner.com/