Just install Swift today on Linux to check it out.
Try a small example of the currying result in a warning that the currying syntax will change in the future, however I could not find anything about what this new syntax looks like.
Curry example I tried:
func do_stuff(x: Int) (y: Int) (z: Int) -> Int {
return (x - y) * z
}
let curry_fun = do_stuff(42)
let x = curry_fun(y: 7)(z: 3)
compiling this example results in the following warning:
warning: curried function declaration syntax will be removed in a future version of Swift; use a single parameter list
func do_stuff(x: Int) (y: Int) (z: Int) -> Int {
^~~~~~~~~~~~~~~~~~~~~~~~~~
, ,
So what does currying look like in the future fast?
I tried something like func do_stuff(x: Int, y: Int, z: Int) -> Int..., however, I could not find a way to do this using this function.
source
share