mirror of
https://github.com/tursom/TursomServer.git
synced 2025-03-23 16:10:06 +08:00
add curry
This commit is contained in:
parent
03b83bbe17
commit
dc9f8e440f
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -68,11 +68,9 @@ class CurryBuilder {
|
||||
append(" }\n")
|
||||
append("}) {\n")
|
||||
if (index > 2) (1..index - 2).forEach { overrideInvoke ->
|
||||
append(
|
||||
" override operator fun invoke(${argsWithType(overrideInvoke)}): Curry${index - overrideInvoke}<${
|
||||
append(" override operator fun invoke(${argsWithType(overrideInvoke)}): Curry${index - overrideInvoke}<${
|
||||
types(overrideInvoke + 1, index)
|
||||
}, R> = Curry${index - overrideInvoke} { ${args(overrideInvoke + 1, index)} ->\n"
|
||||
)
|
||||
}, R> = Curry${index - overrideInvoke} { ${args(overrideInvoke + 1, index)} ->\n")
|
||||
append(" $invokeAction\n")
|
||||
append(" }\n")
|
||||
append("\n")
|
||||
@ -126,10 +124,8 @@ class CurryBuilder {
|
||||
|
||||
println("operator fun <$types, R> (($types) -> R).invoke() = curry(this)")
|
||||
(1 until index).forEach { argCount ->
|
||||
println(
|
||||
"operator fun <$types, R> (($types) -> R).invoke(${argsWithType(argCount)}) = " +
|
||||
"curry(this)(${args(argCount)})"
|
||||
)
|
||||
println("operator fun <$types, R> (($types) -> R).invoke(${argsWithType(argCount)}) = " +
|
||||
"curry(this)(${args(argCount)})")
|
||||
}
|
||||
println()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user