2023-07-01 11:58:00 -04:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
|
|
func addN(n: int) -> Callable:
|
2026-02-01 16:33:20 -08:00
|
|
|
return func(x):
|
|
|
|
|
return n + x
|
2023-07-01 11:58:00 -04:00
|
|
|
|
|
|
|
|
func _ready():
|
2026-02-01 16:33:20 -08:00
|
|
|
# Test currying
|
|
|
|
|
var add2 := addN(2)
|
|
|
|
|
print(add2.call(7))
|
2023-07-01 11:58:00 -04:00
|
|
|
|
2026-02-01 16:33:20 -08:00
|
|
|
get_tree().quit() # Exit
|