This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Using Kawa extensions in R7RS libraries
- From: Per Bothner <per at bothner dot com>
- To: ElÃas Alonso G.-Cornejo <eliasagc at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Sun, 5 Jul 2015 09:17:50 -0700
- Subject: Re: Using Kawa extensions in R7RS libraries
- Authentication-results: sourceware.org; auth=none
- References: <m28ug38opn dot fsf at gmail dot com> <54DCE968 dot 7000800 at bothner dot com> <m2d25aaoj7 dot fsf at gmail dot com> <54E2DE69 dot 2060708 at bothner dot com> <851CA162-87C3-4161-BD7D-338E6AC34FEC at theptrgroup dot com> <552B70EC dot 8040608 at bothner dot com> <CANfjrNW0FFmM3Xp5gX+BNqAbq2Y=C2OiuHYEXv50Y09r9NWipA at mail dot gmail dot com>
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)