From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55808 invoked by alias); 1 Apr 2017 20:00:48 -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 54302 invoked by uid 89); 1 Apr 2017 20:00:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ua0-f172.google.com Received: from mail-ua0-f172.google.com (HELO mail-ua0-f172.google.com) (209.85.217.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 20:00:45 +0000 Received: by mail-ua0-f172.google.com with SMTP id d64so10997735uad.2 for ; Sat, 01 Apr 2017 13:00:46 -0700 (PDT) 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=mbvjMQL8O5GfogeMlltAsFLFstCq5YLIwpsEmnlmmEE=; b=ddSzpfliAeEdYFJhH2mDG79LJbcYand89RS0SSdgLiKS7BUQe30ifWturA8FfmXafF sQmfPiudbcf7rHN0Uo/VLpFHPf6UEK3OAkYg7jA8KAv16ciYN+V4MPZ0jMUC+X2uVQ9K MCxU8zj6R5LDyQxRR0ETzA+3WblZfzShtD0d9EAewRf/b3+3pSdc6XPi/VyejUwy8UL6 TjT6gh8w3jJOYI2lajHm784x+yiOtcx0qXP3oAgH5jbEOTivsxJOpedP1yT0maEE6uWN x8i3l5Ic3Fe2c2nPXJtkFeAZ0GPJ3lrE9XiGZihhTDVBcL8sxPL/KPd58obVVHNqU76a 0crA== X-Gm-Message-State: AFeK/H0MsmBiC/xKCkeGuYyzfzAJAcuwDX5ZG25dkGdYxW+iBBRGQBhqRtCKrqZhfxsQipHAyDWdnZRD6FSYPQ== X-Received: by 10.176.84.193 with SMTP id q1mr4204346uaa.59.1491076845310; Sat, 01 Apr 2017 13:00:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.81.136 with HTTP; Sat, 1 Apr 2017 13:00:45 -0700 (PDT) In-Reply-To: References: <58919df1-afe7-ae3b-0fdc-bb428c8ba3ed@bothner.com> <90df5850-958b-db89-f6e4-93a12d6e5cf3@bothner.com> From: Vasantha Ganesh Date: Sat, 01 Apr 2017 20:00:00 -0000 Message-ID: Subject: Re: Help, writing kawa equivalent of java program To: Per Bothner Cc: kawa@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00011.txt.bz2 Sorry for excluding the code, here it goes: (define-alias library com.sun.jna.Library) (define-alias native com.sun.jna.Native) (define-simple-class libc (library) interface: #t (getpid::long)) (define inst::libc (native:loadLibrary "c" libc:class)) (display (inst:getpid)) On Sun, Apr 2, 2017 at 1:28 AM, Vasantha Ganesh wrote: > Hello Mr. Bothner, > I still get this error: > > [homonculus@alchemist kawa-scheme]$ kawa -J-cp > -J/usr/share/java/jna.jar:.:/usr/share/java/kawa-2.0.jar -f > jnagetpid.scm > Exception in thread "main" java.lang.ClassFormatError: Illegal field > modifiers in class libc: 0x1 > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:763) > at java.lang.ClassLoader.defineClass(ClassLoader.java:642) > at gnu.bytecode.ArrayClassLoader.loadClass(ArrayClassLoader.java:125) > at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:135) > at gnu.expr.ModuleExp.evalModule1(ModuleExp.java:259) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:214) > at kawa.Shell.run(Shell.java:291) > at kawa.Shell.runFile(Shell.java:524) > at kawa.Shell.runFileOrClass(Shell.java:447) > at kawa.repl.processArgs(repl.java:260) > at kawa.repl.main(repl.java:871) > > Thank you, > Vasantha Ganesh K. > > On Sun, Apr 2, 2017 at 1:22 AM, Per Bothner wrote: >> On 04/01/2017 12:44 PM, Vasantha Ganesh wrote: >>> >>> Thank you, that did work. Kawa complains that the interface that I >>> created in kawa is not an interface. >> >> >> (define-simple-class libc (library) >> (make-interface #t) >> (getpid::long)) >> >> - defines a field named make-interface. >> You probably want: >> >> (define-simple-class libc (library) >> interface: #t >> (getpid::long)) >> >> -- >> --Per Bothner >> per@bothner.com http://per.bothner.com/