module container中的sharing type的问题

SML中的module container可以用sharing type来限定内部各模块间的sharing constraints:
structure Graph : EdgeGraphSig
structure WMap : ReadablePropertyMapSig
structure DMap : ReadWritePropertyMapSig
structure PMap : ReadWritePropertyMapSig
sharing type DMap.key_t =
PMap.key_t =
PMap.value_t =
Graph.vertex_t
end
ocaml没有提供sharing type, 只能用with来做sharing constraints. 但是在moudle container中如何使用with呢?
下面的代码会造成Syntax error:
- Login to post comments
- 260 reads
Sun, 2008/10/12 - 18:09 — code17

类似
...... full content is only available to community members.
- Login to post comments
Mon, 2008/10/13 - 18:34 — fishmacs

又犯错误了
...... full content is only available to community members.
- Login to post comments
Fri, 2008/10/17 - 11:32 — fishmacs

对了,还有个问题
...... full content is only available to community members.
- Login to post comments
Fri, 2008/10/17 - 17:39 — code17

指的是 SML'97 修订的这个语义?
...... full content is only available to community members.
- Login to post comments
Sat, 2008/10/18 - 00:11 — fishmacs

这样写不行的
...... full content is only available to community members.
- Login to post comments
Sun, 2008/10/19 - 17:13 — code17

Unbound 是因为顺序问题
...... full content is only available to community members.
- Login to post comments
Mon, 2008/10/20 - 15:08 — fishmacs

顺序应该没有问题的
...... full content is only available to community members.
- Login to post comments
Mon, 2008/10/20 - 16:37 — code17

或者说缺一个 module 的 "self"
...... full content is only available to community members.
- Login to post comments
Tue, 2008/10/21 - 10:17 — fishmacs

实际上我觉得with module不光涵盖了types, 还包括values
...... full content is only available to community members.
- Login to post comments
Tue, 2008/10/21 - 16:55 — code17

Given X:A, Y:B with module Y = X
...... full content is only available to community members.
- Login to post comments
Wed, 2008/10/22 - 11:33 — fishmacs

按照我看到的说法,sharing只是在不同signatures的同名types之间产生约束
...... full content is only available to community members.
- Login to post comments
Fri, 2008/10/24 - 01:42 — code17

上面说的正是 OCaml
...... full content is only available to community members.
- Login to post comments
|
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> |