【发布时间】:2016-11-19 18:15:06
【问题描述】:
我正在尝试通过附加到列表来创建唯一列表,但出现此错误。
Error: This expression has type 'a list
but an expression was expected of type unit
in_list 是一个布尔函数,用于检查值是否在列表中。
if(in_list x seen_list) then print_string("Already found") else seen_list@x in
List.iter uniq check_list;;
看来我必须为 append 函数修复一些小的语法错误。有什么建议吗?
【问题讨论】: