From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126169 invoked by alias); 22 Mar 2017 21:15:44 -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 124208 invoked by uid 89); 22 Mar 2017 21:15:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:10.9.9, HTo:D*info 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, 22 Mar 2017 21:15:35 +0000 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cqnbI-00040y-2e; Wed, 22 Mar 2017 22:15:24 +0100 Received: from 70-36-239-163.dsl.dynamic.fusionbroadband.com ([70.36.239.163] helo=localhost.localdomain) by mailfront11.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1cqnau-0000qm-LO; Wed, 22 Mar 2017 22:15:00 +0100 Subject: Re: R7RS Libraries and Java interaction To: Peter Lane , kawa@sourceware.org References: <788f96d2-c723-f38b-077b-1b6040aa6a16@peterlane.info> From: Per Bothner Message-ID: <0c8cd4f3-6818-9e4d-c965-141eb090fbde@bothner.com> Date: Wed, 22 Mar 2017 21:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <788f96d2-c723-f38b-077b-1b6040aa6a16@peterlane.info> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00092.txt.bz2 On 03/22/2017 01:55 PM, Peter Lane wrote: > Is it possible to make an R7RS library recognise Java interaction when compiled? > > e.g. if I try compiling the following: > > (define-library (java) > (export get-num) > (import (scheme base)) > > (begin > (define (get-num) ((String "hello"):length)) > )) > > $ kawa --r7rs -C java.sld(compiling java.sld to java) > java.sld:7:54: warning - no declaration seen for :length It seems to work if you leave off the --r7rs flag. The --r7rs disables features that conflict with R7RS, such as the special meaning of colon, since in R7RS colon is just a regular symbol character. You don't need it for this example. > $ kawa --r7rs try-java.sps java.sld:7:54: unbound location: :length > at gnu.mapping.SharedLocation.get(SharedLocation.java:22) > at gnu.mapping.DynamicLocation.get(DynamicLocation.java:28) > at java.getNum(java.sld:7) > > If I rewrite get-num to use invoke, I still get compilation warnings, but it works at runtime. That can be fixed by adding: (import (only (kawa base) invoke)) -- --Per Bothner per@bothner.com http://per.bothner.com/