(我正在使用SML / NJ)
列表结构http://sml-family.org/Basis/list.html包括@,hd,tl,null,concat等。
其中一些可用而没有前缀:@,hd,tl,[],concat。但是其他(例如存在)和nth需要List前缀。见下文:
Standard ML of New Jersey v110.79 [built: Tue Aug 8 23:21:20 2017]
- op @;
val it = fn : 'a list * 'a list -> 'a list
- concat;
val it = fn : string list -> string
- nth;
stdIn:3.1-3.4 Error: unbound variable or constructor: nth
- exists;
stdIn:1.2-2.1 Error: unbound variable or constructor: exists
- List.nth;
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
val it = fn : 'a list * int -> 'a
- List.exists;
val it = fn : ('a -> bool) -> 'a list -> bool
为什么?我试图在“标准ML(1997)的定义”中找到答案,但找不到与此相关的任何内容。
某些名称是不合格的,因为它们也绑定在SML Basis库的顶级环境中,包括您列出的名称。请参阅此处以获取完整列表。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句