This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using Kawa extensions in R7RS libraries




On 07/05/2015 12:31 AM, ElÃas Alonso G.-Cornejo wrote:
I've been having some trouble using

(object ...)

to create anonymous classes inside

(define-library ...)

declarations. I've added (import (kawa base)), but Kawa tries to
instantiate java.lang.Object instead of creating the anonymous class.
Where is the (object ...) macro defined? I've looking in lib/kawa,
but can't find it.

The object macro is implemented by the Java code kawa/standard/object.java.
(You can see this by searching for "object" in kawa/standard/Scheme.java.)

It looks like 'object' is missing in (kawa base).  Please try the
attached patch and let me know if that fixes the issue.

We need to systematically go through the kawa extensions and add
them to (kawa base).  (We should also re-do the bindings in Scheme.java
to use (kawa base) rather than duplicate it.)
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Index: kawa/lib/kawa/base.scm
===================================================================
--- kawa/lib/kawa/base.scm	(revision 8556)
+++ kawa/lib/kawa/base.scm	(working copy)
@@ -25,6 +25,7 @@
 
 	  define-class
 	  define-simple-class
+          object
 	  this
 
 	  invoke
@@ -105,6 +106,9 @@
 		 (define_class define-class))
 	 define-simple-class define-class)
 
+   (only (kawa standard object)
+         (objectSyntax object))
+
    (only (rename (kawa standard thisRef)
 		 (thisSyntax this))
 	 this)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]