Why do the functions you build inside a loop all end up returning the last value?
A closure captures the variable, not the value it held at the time. All three lambdas share one cell for the loop name, the loop leaves that cell holding its final value, and every call reads it then. Bind per iteration with a default argument or a factory to fix it.