News for hackers. Stuff that matters.
Re:Cloture: Clojure in Common Lisp by lvh on Friday February 14, 2020 @08:44AM (#22326399)
It does not seem easier to me to use Java libs from ABCL than Clojure.

Some Java:

  public class Main {
    public int addTwoNumbers(int a, int b) {
      return a + b;
    }
  }
Calling it from ABCL:

  (defun void-function (param)
    (let* ((class (jclass "Main"))
           (intclass (jclass "int"))
           (method (jmethod class "addTwoNumbers" intclass intclass))
           (result (jcall method param 2 4)))
      (format "calling addTwoNumbers(2, 4): ~a~%" result)))
Calling it from Clojure:

  (defn f []
    (prn "calling addTwoNumbers(2, 4): " (.addTwoNumbers (Main.) 2 4)))
Note that the Clojure version creates the object, and the ABCL version doesn't do that for you; you still need to instantiate a Main yourself.
Re:Cloture: Clojure in Common Lisp by fmakunbound on Friday February 14, 2020 @01:02PM (#22328609)
Something like:

    (require :jss)

    (defun f() 
      (format t "calling addTwoNumbers(2, 4): ~A" (#"addTwoNumbers" 'Main 2 4))
Re:Cloture: Clojure in Common Lisp by lvh on Sunday February 16, 2020 @04:16PM (#22343806)
Thanks! I didn't know about :jss and will happily concede that's equivalent to the Clojure version.