source: trunk/abcl/test/lisp/abcl/java.lisp @ 14694

Last change on this file since 14694 was 14694, checked in by mevenson, 3 years ago

Convert Lisp truth values to Java equivalents in JCALL/JSTATIC.

We now convert CL:T and CL:NIL to JAVA:+TRUE+ and JAVA:+FALSE+
respectively when invoking JVM methods through the JAVA package,
establishing the "natural" equivalence for boolean truth values. This
may break some existing usage in that previously CL:NIL was converted
to a Java 'null' reference. Users now need to specify JAVA:+NULL+
explicitly when desiring to pass 'null' Java references as an argument
in invoking JVM methods.

Addresses <> (#84) and
<> (#339).

File size: 873 bytes
1(in-package #:abcl.test.lisp)
3(deftest java.truth.1
4  (let (( 
5         (java:jmethod "java.lang.Boolean" "compare" "boolean" "boolean"))
6        (java.lang.boolean.equals 
7         (java:jmethod "java.lang.Boolean" "equals" "java.lang.Object")))
8    (values 
9     (java:jstatic "java.lang.Boolean" java:+true+ t)
10     (java:jstatic "java.lang.Boolean" java:+false+ nil)
11     (java:jcall java.lang.Boolean.equals java:+true+ t)
12     (java:jcall java.lang.Boolean.equals java:+false+ nil)
13     (java:jstatic "java.lang.Boolean" java:+false+ t)
14     (java:jstatic "java.lang.Boolean" java:+false+ t)
15     (java:jcall java.lang.Boolean.equals java:+true+ nil)
16     (java:jcall java.lang.Boolean.equals java:+false+ t)))
17  0 0 t t -1 -1 nil nil)
Note: See TracBrowser for help on using the repository browser.