These are chat archives for ChaiScript/ChaiScript

25th
Mar 2016
hia3
@hia3
Mar 25 2016 08:48
Does ChaiScript support currying/closures? Can I do something like this - var my_fun = fun(x,y) { fun(a) { a + x + y } } ?
Jason Turner
@lefticus
Mar 25 2016 12:48
This message was deleted
@hia3 you have to be explicit about which variables you want captured, but yes:
eval> var f = fun(x,y){fun[x,y](a){x+a+y}}
eval> f(1,2)(3)
6