Skip to content

Function should include apply() #5419

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

Closed
gbracha opened this issue Sep 24, 2012 · 3 comments
Closed

Function should include apply() #5419

gbracha opened this issue Sep 24, 2012 · 3 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@gbracha
Copy link
Contributor

gbracha commented Sep 24, 2012

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.

@gbracha
Copy link
Contributor Author

gbracha commented Sep 24, 2012

@gbracha
Copy link
Contributor Author

gbracha commented Oct 8, 2012

Current state of play is that Function includes a static method

apply(Function target, List positionalArguments, [Map<String, dynamic> namedArguments])

@floitschG
Copy link
Contributor

Closing since all implementations now support the static apply function.


Added Fixed label.

@gbracha gbracha added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Nov 7, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

2 participants