CL-USER> (java:jstatic "sqrt" "java.lang.Math" 17.0d0)
4.123105625617661d0
this post was submitted on 18 Oct 2023
1 points (100.0% liked)
Lisp
67 readers
3 users here now
founded 2 years ago
MODERATORS
To add more context to this response: Java has this notion of static methods that belong to classes, compared to the regular methods that belong/act on instances. So ABCL's jmethod is to call a method using an instance, while jstatic is to call a static method using a class. Math.sqrt happens to be a static method of Math class, so use jstatic. Once this static/regular distinction is cleared up, ABCL interface becomes quite usable.