【发布时间】:2011-03-08 14:32:58
【问题描述】:
在我的 ml 程序中,我使用嵌套结构来构建我的代码。我正在为这些结构定义签名 - 但我无法真正嵌套签名。
例子:
structure Example =
struct
structure Code =
struct
datatype mytype = Mycons of string
end
end
为此,我想做这样的事情:
signature EXAMPLE =
sig
signature CODE = (* or stucture Code - doesn't matter *)
sig
datatype mytype
end
end
现在这行不通了;我收到语法错误。我的问题:
- 这是个坏主意吗?如果是,为什么?
- 我该怎么做?如何将嵌套签名应用于嵌套结构?
【问题讨论】: