From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89242 invoked by alias); 25 Sep 2015 15:49:32 -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 89229 invoked by uid 89); 25 Sep 2015 15:49:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: smtps-n.oca.eu Received: from smtps-n.oca.eu (HELO smtps-n.oca.eu) (192.54.174.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Sep 2015 15:49:30 +0000 Received: from asteroide.oca.eu (dhcp2-21.oca.eu [10.250.2.21]) by smtps-n.oca.eu (Postfix) with ESMTPSA id DC81680A3A; Fri, 25 Sep 2015 17:49:27 +0200 (CEST) Message-ID: <56056D07.4000609@unice.fr> Date: Fri, 25 Sep 2015 15:49:00 -0000 From: Damien Mattei User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Per Bothner CC: kawa@sourceware.org Subject: Re: packaging classes in kawa References: <1443119328.2480.4.camel@german-HP-245-G2-Notebook-PC> <56044CD1.2050802@bothner.com> <56050E2E.4010902@unice.fr> <56050F58.4040507@unice.fr> <560547CB.4040000@unice.fr> <560564EB.9040008@bothner.com> In-Reply-To: <560564EB.9040008@bothner.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-q3/txt/msg00090.txt.bz2 i do not understand well... i have a netbeans project for testing all those stuff: in java file i have : package eu.oca; import gnu.expr.RunnableModule; import gnu.lists.LList; import gnu.lists.Pair; import eu.oca.scheme.Vector2D; ... /** * Retrieves representation of an instance of eu.oca.serviceResource * @return an instance of java.lang.String */ @GET @Produces("text/html") public String getHtml( @DefaultValue("toto") @QueryParam("name") String nom ) { Vector2D vec = new Vector2D( 1, 2); Object[] lst = {2, 3}; double res=vec.norm(); //Object result = vec.plus.applyN(lst); LList glst = new LList(); //glst = glst.list2(2,3); // works also glst = LList.list2(2,3); Object result0 = vec.plus(glst); int r = (int) result0; Pair pair = new Pair(2, LList.Empty); Pair pair2 = new Pair(3, pair); LList glst2 = new LList(); glst2 = pair2; Object result = vec.plus(glst2); Object result1 = vec.carre(glst); CreateHTML html = new CreateHTML(); //TODO return proper representation object return html.getHtml()+"

REST in peace " + nom + " with "+ glst + " r = "+ r +" glst2 : "+glst2+" result : "+result+" result1 :"+result1+" !

"; //throw new UnsupportedOperationException(); } and a kawa scheme file: (module-name "eu.oca.scheme.Vector2D") (define-simple-class Vector2D () ... i made a jar file of eu.oca.scheme.Vector2D put it in library in the project with add jar/folder in the IDE all compile now very well and run on a tomcat server this is of course only for testing... i can call kawa scheme function from a java netbeans project, that was what i wanted. well ok your right i imported the class, but for netbeans i was forced to put the kawa generated classes in a package ,i can not import in the project a simple class with no source code . Le 25/09/2015 17:14, Per Bothner a écrit : > > > On 09/25/2015 06:10 AM, Damien Mattei wrote: >> great ! >> >> so the scheme modules map to java packages... > > No, Scheme modules map to Java *classes*. > > This is the "module class" itself. They may be additional > classes (ones defined by define-class/define-simple-class, > and "frame" classes used for closures). This are all in the same > package. > The frame classes are member classes or inner classes. > A define-class is (by default) a member class of the module class; > a define-simple-class is (by default) a sibling class (unless it has > same name as the module class, in which case they are combined).