以下丢弃了导入的注解
(ns com.example.BaseXModuleTest
(:import (org.basex.query QueryModule QueryModule$Deterministic))
(:gen-class
:extends org.basex.query.QueryModule
:methods [
[^{QueryModule$Deterministic {}}
addOne [int] int]]))
然而,当将{{gen-class}}调用从{{ns}}声明移出时,注解被正确应用
(ns com.example.BaseXModuleTest
(:import (org.basex.query QueryModule QueryModule$Deterministic)))
(gen-class
:extends org.basex.query.QueryModule
:name com.example.BaseXModuleTest
:methods [
[^{QueryModule$Deterministic {}}
addOne [int] int]])
似乎在从{{ns}}声明运行gen-class时,导入的名称尚未在作用域内。