I would like to have a function returning a function that returns a function with the same signature as the first function. I.e. the function should be able to provide itself as a return value.
Is this possible in swift?
Example (this does not compile!):
typealias nextStep = ((char: CChar) -> nextStep)
func process(char: CChar) -> nextStep {...}
Copyright Notice:Content Author:「Rien」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/27705796/function-return-a-function-that-returns-a-function