有F#內置運算符/函數,它允許解壓參數列表/元組並將其傳遞給函數調用?F# - 圖示/解包參數列表
用法示例:
// simple add function
let add (a1 : int) (a2 : int) (a3 : int) = a1 + a2 + a3
// what I want to achieve
let result = add (missing_operator)[1; 2; 3]
// or
let result' = add (missing_operator) (1, 2, 3)
// flattening list
let a = [1; 2; 3]
let b = [(missing_operator) a; 4; 5]
類同Python的*操作
def add(a1, a2, a3):
return a1 + a2 + a3
add(*[1,2,3])
或應用(FUNC_NAME,args_list)功能
apply(add, [1, 2, 3])
可能相關:http://stackoverflow.com/q/30622850/126014 –