Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可以使用 Clojure 的 gen-class 宏生成以下类吗?
public class Test { public static final String TEST_NAME = "This test's name."; }
如果不是,为什么不呢?
不,gen-class 不能生成静态字段,因为 gen-class 用于 introp。它试图让您能够创建其他 java 库所需的类。java lib 很少要求您提供具有特定静态字段的类。