Skip to content

Lambda Types Addendum #103

@DavePearce

Description

@DavePearce

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions