Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda Types Addendum #103

Open
DavePearce opened this issue Dec 1, 2021 · 0 comments
Open

Lambda Types Addendum #103

DavePearce opened this issue Dec 1, 2021 · 0 comments

Comments

@DavePearce
Copy link
Member

DavePearce commented Dec 1, 2021

Overview

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant