From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13833 invoked by alias); 3 Mar 2014 21:15:55 -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 13820 invoked by uid 89); 3 Mar 2014 21:15:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Mon, 03 Mar 2014 21:15:53 +0000 Received: from [10.9.9.207] (helo=mailfront03.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1WKaDG-0003VA-92; Mon, 03 Mar 2014 22:15:50 +0100 Received: from 70-36-239-203.dsl.dynamic.sonic.net ([70.36.239.203] helo=localhost.localdomain) by mailfront03.runbox.com with esmtpsa (uid:757155 ) (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) id 1WKaDF-0003DO-5d; Mon, 03 Mar 2014 22:15:49 +0100 Message-ID: <5314F102.2020600@bothner.com> Date: Mon, 03 Mar 2014 21:15:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Marius Kjeldahl CC: kawa@sourceware.org Subject: Re: Questions regarding modules References: <531267B8.6040407@bothner.com> <53144610.9040207@bothner.com> <5314E655.7090809@bothner.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-q1/txt/msg00091.txt.bz2 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/