swift函数柯里化:
func bigThan(a:Int,b:Int) -> Bool
{
return a >b
}
let initianlBig = bigThan(10)
initianlBig(b:11)
-
先传部分参数,返回一个函数后再传入剩余的参数,再执行原始函数的代码体
----------------------------------------------------------------------------------
swift输入输出参数:
func change(inout a:Int,inout b:Int)
{
let c = b
b = a
a = c
}
var x = 0,y = 100
change(&x,b:&y)
print(x,y)
---------------------------------------------------------------------------------
函数类型:由参数类型和返回值类型组成
samp:(Int,Int) ->Int