Skip to content

Consider allowing anonymous function expressions #450

Open
@tomek-he-him

Description

@tomek-he-him

At the moment you forbid unnamed function expressions like function() {}. That’s a good thing.

But when using the new function bind syntax with trine-style libraries, you can’t use arrow functions because they inherit this from the outer scope.

So a good old anonymous function expression:

[my, collection]::map(function() {
  return !!this;
});

…often feels more natural than inventing obscure names:

[my, collection]::map(function justCastToBoolean() {
  return !!this;
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions