4 ms·
In K, you can write a lambda with an explicit argument list: {[a;b]a+b} But if you leave it off, the names "x", "y", and "z" implicitly refer to the first
by RodgerTheGreat 3y ago
In K, you can write a lambda with an explicit argument list:
{[a;b]a+b}
But if you leave it off, the names "x", "y", and "z" implicitly refer to the first three arguments, and their presence controls the valence (arity) of the lambda.
{x+y} / a lambda with two arguments
{y} / also a lambda with two arguments, discarding the first
Using the implicit names for short definitions is highly idiomatic. By removing an unnecessary degree of freedom, it increases the likelihood that two K programmers will arrive at identical formulations of a short piece of code.