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

Change ordering of arguments for WriteInterceptor and InvokeInterceptor? #1

Open
jakemac53 opened this issue Mar 31, 2015 · 0 comments

Comments

@jakemac53
Copy link

Currently the proposal is the following:

abstract class WriteInterceptor {
  set(target, value, Member member);
}

abstract class InvokeInterceptor {
  invoke(target, List positionalArguments, Map<Symbol,dynamic> namedArguments,
      Member member);
}

I would like to propose that we change member to always be the 2nd argument:

abstract class WriteInterceptor {
  set(target, Member member, value);
}

abstract class InvokeInterceptor {
  invoke(target, Member member, List positionalArguments,
      Map<Symbol,dynamic> namedArguments);
}

This is more intuitive, because it looks more like the calls its actually intercepting. For example when assigning a property:

foo.bar = 'baz';

The set method would be called with foo, a member whose name is #bar, and the value 'baz', in that order. With the current semantics 'baz' would come before the member with name #bar, which isn't as intuitive.

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

No branches or pull requests

2 participants