are there languages with λs where which ids are params is only specified at the callsite? like with the closure providing defaults. similar to optional params. eg if we do
let🔧= +
let🍎= 2
let🍊= 3
let 🔥= λ{🍎🔧🍊}
then we can do
🔥() = 5
🔥(🍎: 4🍊: 4) = 8
🔥(🔧: *) = 6
Conversation
Maybe have a look at the label selective lambda calculus? Some form of it was eventually added to OCaml. Not sure if it covers optional parameters though.
2
hmm... i may be misunderstanding the lslc, but i don't think it's the same? lslc lambdas specify a variable. in my version, lambdas have no explicitly associated local variables; or equivalently, every variable in their body is potentially a local variable
1
Ahh was more pointing to the default parameter bit. Not sure if lslc covers it or if OCaml tacked it on afterwards.
1
Like, I’d assume your local variables would need some sort of ‘public name’? I guess in your example it’s more like you are overriding the captured variables. Hmmmm
Replying to
yes. to be precise, the definition site semantics are identical to a typical function definition in a language with closures, except treating every definition as a zero-parameter function. but at each call site, you can choose to override any number of values in the closure.
1
or in other words, the partitioning of all identifier occurrences in the body of a function literal into parameters and closed-over values is determined at the call site, not the definition site

