0
let add_information info = match info with
(int * int * int) -> int + int + int
;;
let result = add_information (1, 2, 3);;
print_int result;; (* should print 6 here *)
我相信你可以像列表一樣匹配元組。只是不確定確切的格式。OCaml匹配元組
或在函數參數中匹配它們,如'let add_information(a,b,c)= ...' – nlucaroni
感謝您的答案 – user3509086