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

后端 未结 2 821
温柔的废话
温柔的废话 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: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.

提交回复
热议问题