Skip to content

Function should include apply() #5419

Closed
@gbracha

Description

@gbracha

The Function class should have a method

apply(ArgumentDescription args);

where

class ArgumentDescriptor {
  final List positionalArguments;
  final Map<String, dynamic> namedArguments;

  ArgumentDescriptor(List this.positionalArguments,
                     Map<String, dynamic> this.namedArguments);
}

Now that Function is a class, it would make sense to have Function contain an implementation.

Real functions need to have a magical apply() that takes the incoming formal parameter args, extracted the actual arguments from it and invoked the function. However, the Function class is presumably separate, and could define apply as:

apply(ArgumentDescription args) => this.call.apply(args);

 It would be quite reasonable for people to extend (not just implement) Function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions