This is the mail archive of the kawa@sources.redhat.com 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]

Unbound scheme procedures when calling from Java


We are trying to call our own Scheme procedures from Java.  The
problem is that only a part of the Scheme standard procedures seem to
be bound.  When using kawa interactively these procedures have correct
bindings.  The following files illustrate the problem:

===small.scm===

;;; Is reverse and append bound in the current environment?
(define (test)
  (format #t "Reverse = ~S~%" reverse)
  (format #t "Append = ~S~%" append))

===UseSmall.java===

import kawa.standard.Scheme;

public class UseSmall {
    public static void main(String[] args) {
	Scheme.registerEnvironment();
	small.test();
    }
}

===interactive run===

> kawa
#|kawa:1|# (load "small")
#|kawa:2|# (test)
Reverse = #<procedure reverse>
Append = #<procedure append>
#|kawa:3|#

===Call from Java===

> java UseSmall
Reverse = #<procedure reverse>
Exception in thread "main" java.lang.NullPointerException
        at small.test(small.scm:4)
        at UseSmall.main(UseSmall.java:6)

====

What can be the problem here? Is this the correct way to use Scheme
from Java?

Esko Nuutila


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