From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22775 invoked by alias); 29 Jan 2017 06:07:34 -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 22753 invoked by uid 89); 29 Jan 2017 06:07:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*Ad:U*kawa, H*r:sk:kawa@so, counterparts X-HELO: mail-ua0-f171.google.com Received: from mail-ua0-f171.google.com (HELO mail-ua0-f171.google.com) (209.85.217.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Jan 2017 06:07:21 +0000 Received: by mail-ua0-f171.google.com with SMTP id 96so231336831uaq.3 for ; Sat, 28 Jan 2017 22:07:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DSvlywTnT6GDQKFjVRVKlLWoL7CUfd83yvCUT3YQ/oc=; b=aYttUXe62AtHkNW7MMrsLZaGnAytNIZ5bZJJM8GYMixjTcbSwDnH4nLfBy74uh0/2G GYdM8BeaVH8NS+GWRUd9hiv96B55E7Dpfqbx2SKZIEuSkqS2Nm+JJJCacj35etumeCPq JsuCJK1Mxx197/U1krNqg1k0l12Shq12Qc6f8l36mBquTW9wMRpF3NH7mkcRAG9MVVzv AvLzaNnEy1rhTzYk4hcmAmNYmgMRAXhNIkQe06bZo4WgVDv6Z0tMD2XsBihGDT0uPBpB pC29Bi0Eg9GwjZAFbHGsmbwhg7/QYy/K0GCS/T4riLNd0ez4cF2pFTG9iXdbF1kyxlmE n5VQ== X-Gm-Message-State: AIkVDXJo0xTc+QQM+D0S34RGhKMDwYu48UIyD54hTBp3YpH+zeJVW5TqYqKDoXKAMtkagNLWzVvvkSbZmqFSjg== X-Received: by 10.176.22.136 with SMTP id e8mr7089511uaf.154.1485670039929; Sat, 28 Jan 2017 22:07:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.48.66 with HTTP; Sat, 28 Jan 2017 22:07:19 -0800 (PST) In-Reply-To: References: From: scprotz Date: Sun, 29 Jan 2017 06:07:00 -0000 Message-ID: Subject: Re: Missing feature or just differences with Guile for define-public To: Per Bothner Cc: kawa@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-q1/txt/msg00039.txt.bz2 So my guess is, from a functional point of view, 'define-public' is essentially like 'extern' in C (exposing the function to the C/Gnome) calls? I have already reviewed the C/C++ code in Aisleriot and converting it from C to Java has been very easy so far (since GTK/Glib have very similar counterparts in Java). I'm just trying to figure out how I'd make the functional equivalent of a 'define-public' in a Kawa program so that my Java app can call it, or is everything automatically exposed as part of the compiled class once compiled by Kawa (i.e. there would be a class called "api.class" and it would have a function called "setFeatures"? Again, my exposure to Kawa specifically is limited at this time, so just looking for pointers. If all defines are exposed as class objects (methods), then just changing define-public to define might be good enough (since define-public seems to be a guile-specific thing to expose functions to C). -scprotz On Sun, Jan 29, 2017 at 3:07 AM, Per Bothner wrote: > On 01/28/2017 04:40 AM, scprotz wrote: >> >> I was trying to compile the scm files that come with Aisleriot using >> Kawa (these are intended for use with Guile, but I was hoping to try >> them out in Java). Many seem to compile ok, but one of the core >> files, api.scm has problems. >> >> I came across two issues when trying to convert api.scm to .class. >> >> The first was "invalid use of '_". Apparently kawa doesn't like the _ >> as part of define's. Easy enough to fix just by changing the '_ to >> another identifier. >> >> The second issue though was I get "improper list (circular or dotted) >> is not allowed here. >> >> Here is an example define-public from the file: >> >> (define-public (set-features . feature-list) >> (set-feature-word! (+ (get-feature-word) >> (apply + feature-list)))) >> >> My scheme-fu is very very weak, so I'm not sure if this is just an >> implementation difference, a bug, or my misunderstanding. > > > This problem is because Kawa does not define define-public, > so Kawa thinks it is a function call. And an quoted dotted > list is not valid in an expression. > > Kawa has a different module system that Guile. > Specifically, it does not define define-module, > use-module, or define-public. > > It might be possible to define Kawa implementations for > the Guile module system on top of the Kawa module system, > though there would probably be some incompatibilities. > > It seems like Aisleriot depends on lots of native code, > including calls to Gnome. So getting anything working will be > a major porting effort. > > -- > --Per Bothner > per@bothner.com http://per.bothner.com/