This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: Best way to interface Java?
- To: kawa at sourceware dot cygnus dot com
- Subject: Re: Best way to interface Java?
- From: brlewis at alum dot mit dot edu
- Date: 21 Jun 2000 12:58:21 -0400
- References: <s950fe8e.068@tapsellferrier.co.uk>
"Nic Ferrier" <nferrier@tapsellferrier.co.uk> writes:
> 2. I could expect the various procs to be defined when the module is
> loaded
> using:
> environment-bound?
> on the procs that the parser requires would allow me to throw an
> exception or terminate gracefully if they weren't there.
What's wrong with using require? The fact that you don't mention it
suggests you haven't been keeping up with recent changes to Kawa. If
you haven't gone through the manual lately, read it. I'm finding make,
invoke, etc. much easier to deal with than primitive-...
Here's a sample from netfun.scm, part of an upcoming release of BRL
(already checked into CVS):
(define (brl-tcp-socket (server <String>) (port <integer>))
(let* ((sock :: <java.net.Socket>
(make <java.net.Socket> server port))
(instream :: <java.io.InputStream>
(invoke sock 'getInputStream))
(outstream :: <java.io.OutputStream>
(invoke sock 'getOutputStream))
(inport :: <input-port>
(make <input-port> instream server))
(outport :: <output-port>
(make <output-port> outstream server)))
(cons inport outport)))
--
Bruce R. Lewis http://brl.sourceforge.net/