From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23471 invoked by alias); 3 Mar 2014 21:42: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 23459 invoked by uid 89); 3 Mar 2014 21:42:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f47.google.com Received: from mail-oa0-f47.google.com (HELO mail-oa0-f47.google.com) (209.85.219.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 03 Mar 2014 21:42:18 +0000 Received: by mail-oa0-f47.google.com with SMTP id i11so1369220oag.34 for ; Mon, 03 Mar 2014 13:42:16 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.142.229 with SMTP id rz5mr29276450obb.12.1393882936379; Mon, 03 Mar 2014 13:42:16 -0800 (PST) Received: by 10.76.88.103 with HTTP; Mon, 3 Mar 2014 13:42:16 -0800 (PST) In-Reply-To: References: <531267B8.6040407@bothner.com> <53144610.9040207@bothner.com> <5314E655.7090809@bothner.com> <5314F102.2020600@bothner.com> Date: Mon, 03 Mar 2014 21:42:00 -0000 Message-ID: Subject: Fwd: Questions regarding modules From: Marius Kjeldahl To: kawa@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-q1/txt/msg00092.txt.bz2 ---------- Forwarded message ---------- From: Marius Kjeldahl Date: Mon, Mar 3, 2014 at 10:42 PM Subject: Re: Questions regarding modules To: Per Bothner Ah, thanks for confirming my issues; I was starting to go insane over why I couldn't get it working. The import rename makes me feel dirty, but will definitively work for now. The module stuff should probably be fixed eventually (give me enough time and keep answering my questions... ;-). Thanks, Marius K. On Mon, Mar 3, 2014 at 10:15 PM, Per Bothner wrote: > On 03/03/2014 12:50 PM, Marius Kjeldahl wrote: >> >> For good reasons I need to control where >> the exported symbols appear when requiring the module, not when >> defining the individual methods, which is why simply importing all the >> defines doesn't cut it. > > > In that case I suggest using import with either rename or prefix. > For example: > (import (prefix (net kjeldahl kawatest app HelloKawa) kawa-utils-)) > ... > (kawa-utils-hello) > > >> That's why I'm trying to put it into a class >> (I really want a namespace, but who cares). > > > As I see it, a module *is* a namespace. > > >> However, the docs you've written under the section "How a module >> becomes a class" states that using module-name is an alternative to >> define-class, and THIS is what I am struggling to get working. >> >> Without resorting to using define-class in HelloKawa.scm, I am not >> able to use (net.kjeldahl.kawatest.app.HelloKawa:hello) at all. If >> possible, could you show me how I can define the "class" in >> HelloKawa.scm with module-name and defining the hello method in it so >> that it would be callable with the full name >> net.kjeldahl.kawatest.app.HelloKawa:hello from KawaActivity? > > > Doesn't seem to be working for me either. But since it's sort-of > a backdoor part the module system, that may be ok. Still, I'd like to > understand why it isn't working. > > >> I would be perfectly happy to be told that define-class IS what I need >> to use, but based on how I understand the docs, kawa offers a "less >> javalike" method of defining "javalike" classes, and that is what I'm >> trying to figure out. > > > Using import seems to make sense. Though import does need some tweaks > - it should probably be extended to support a source filename, as in > require. > > -- > --Per Bothner > per@bothner.com http://per.bothner.com/