我想在通过模式匹配后打印一个字符串列表,以便使用这个强大的功能。
我如何表达“什么都不做但返回单元”操作?
我的意思是:
let print_nodes nodes =
match nodes with
[] -> (* here i want to noop *)
| s :: t -> print_string s; print_nodes t
我想在通过模式匹配后打印一个字符串列表,以便使用这个强大的功能。
我如何表达“什么都不做但返回单元”操作?
我的意思是:
let print_nodes nodes =
match nodes with
[] -> (* here i want to noop *)
| s :: t -> print_string s; print_nodes t