- (java SYMBOL)syntax
Returns the value represented by SYMBOL which should designate a Java class, field, or method, using `Java Dot' notation:
Syntax Type of Member Example "." at the end constructor ((java Font.) NAME STYLE SIZE) "." at the beginning instance member ((java .setFont) COMP FONT) "." at beginning and "$" at the end instance field (define (mycar x) ((java .first$) x)) (define (myset-car! x y) ((java .first$) x y)) "." only in the middle static member ((java Math.round) 123.456) ".class" suffix Java class (java Font.class) "$" at the end static field (java Font.BOLD$) (set! (java "U.useJavaSyntax$") #t) "$" in the middle inner class (java java.awt.geom.Point2D$Double.class) "$" at the beginning packageless class (java $ParseDemo.class) "#" at the end allow private access ((java .name$#) ((java Symbol.#) "abc")) Notes:
* Each evaluation of the java macro sends an expression to the java process and receives a result expression. Since most of the results will stay constant throughout the lifetime of the session (as they refer to classes, fields and methods), they are cached and subsequent evaluation of the same (java ...) expression will refer to the cached value instead. You can disable this caching (in case you are doing rather funky things) with the help of the java-enable-cache form (see below).
* Java objects which are returned from the Java-side can be safely used and are only garbage collected when no more references exist.