public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: "Elías Alonso G.-Cornejo" <eliasagc@gmail.com>
Cc: kawa@sourceware.org
Subject: Re: Using Kawa extensions in R7RS libraries
Date: Sun, 05 Jul 2015 16:18:00 -0000	[thread overview]
Message-ID: <559958AE.2060101@bothner.com> (raw)
In-Reply-To: <CANfjrNW0FFmM3Xp5gX+BNqAbq2Y=C2OiuHYEXv50Y09r9NWipA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]



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/

[-- Attachment #2: obj.patch --]
[-- Type: text/x-patch, Size: 518 bytes --]

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)

  parent reply	other threads:[~2015-07-05 16:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  9:27 Helmut Eller
2015-02-12 17:57 ` Per Bothner
2015-02-15 20:49   ` Helmut Eller
2015-02-17  6:23     ` Per Bothner
2015-02-17  6:37       ` Per Bothner
2015-04-13  5:45       ` Jamison Hope
2015-04-13  7:32         ` Per Bothner
     [not found]           ` <CANfjrNW0FFmM3Xp5gX+BNqAbq2Y=C2OiuHYEXv50Y09r9NWipA@mail.gmail.com>
2015-07-05 16:18             ` Per Bothner [this message]
2015-07-06  7:30               ` Elías Alonso G.-Cornejo
2015-07-08 14:11                 ` Elías Alonso G.-Cornejo
2015-07-12 23:38                   ` Per Bothner
2015-07-13  0:16                 ` Per Bothner
2015-07-13  9:11                   ` Elías Alonso G.-Cornejo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559958AE.2060101@bothner.com \
    --to=per@bothner.com \
    --cc=eliasagc@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).