Declare array as return type in gen-class method declaration in Clojure

后端 未结 2 822
温柔的废话
温柔的废话 2021-02-05 18:06

How to declare an array in method declaration in gen-class?

(ns foo.bar
(:gen-class
 :methods [[parseString [String Object] Object]]))

That wor

相关标签:
2条回答
  • 2021-02-05 18:34

    Try

    (ns foo.bar
      (:gen-class
        :methods [[parseString [String Object] "[Ljava.lang.Object;"]]))
    
    0 讨论(0)
  • 2021-02-05 18:39

    I needed a

    static Number[][] method(int, Number[][]);
    

    signature, in a similar way:

    (:gen-class
    :methods [#^{:static true} [method [int "[[Ljava.lang.Number;"] "[[Ljava.lang.Number;"]])
    

    seemed to work.

    0 讨论(0)
提交回复
热议问题