3 clojure
假设我有协议ICursor,IFoo,IBar然后我可以有一个名为的函数:
(defn IFoo->IBar [foo] ... )
Run Code Online (Sandbox Code Playgroud)
现在,假设我有一个带有两个参数的函数
x: ICursor
y: IFoo
Run Code Online (Sandbox Code Playgroud)
并输出IBar类型的对象.
现在,有没有标准的方法来表示函数名称?例如,以下工作均不起作用:
(defn ICursor,IFoo->IBar [x y] ...)
Run Code Online (Sandbox Code Playgroud)
因为","被视为空间
(defn (ICursor, IFoo)->IBar [x y] ... )
Run Code Online (Sandbox Code Playgroud)
因为()被视为函数应用程序.
(defn [ICursor, IFoo]->IBar [x y] ... )
Run Code Online (Sandbox Code Playgroud)
因为[]被视为矢量.
是否有一种标准的方法来编码函数名称中的参数协议类型?
谢谢!
| 归档时间: |
|
| 查看次数: |
308 次 |
| 最近记录: |