We desire a way to state that a lambda type is fat. For example, this currently compiles:
type fun_t is function()->(int)
function f(int x) -> fun_t:
return &( -> x)
This is broken because we don't know how to compile the lambda!! It's actually a fat lambda.
Statically Sized (a.k.a. "Fat") Lambdas
A more appropriate type above would be:
type fun_t is function[int]()->(int)
Here, [int] indicates additional types required in the "lambda package". Rust has a similar problem here, but does not allow you to name such lambdas.
Dynamically Sized Lambdas
Another interesting question then is what &fun_t represents in both situations above. Perhaps we need syntax such as function[...]()->(int) to indicate a fat lambda of unknown size.
Overview
We desire a way to state that a lambda type is fat. For example, this currently compiles:
This is broken because we don't know how to compile the lambda!! It's actually a fat lambda.
Statically Sized (a.k.a. "Fat") Lambdas
A more appropriate type above would be:
Here,
[int]
indicates additional types required in the "lambda package". Rust has a similar problem here, but does not allow you to name such lambdas.Dynamically Sized Lambdas
Another interesting question then is what
&fun_t
represents in both situations above. Perhaps we need syntax such asfunction[...]()->(int)
to indicate a fat lambda of unknown size.