Skip to content

Can we implement object queries without parametrizable aexprs? #2

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

Open
onsetsu opened this issue Nov 27, 2016 · 0 comments
Open

Can we implement object queries without parametrizable aexprs? #2

onsetsu opened this issue Nov 27, 2016 · 0 comments

Comments

@onsetsu
Copy link
Member

onsetsu commented Nov 27, 2016

From the paper, we originally had:

class FilterOperator {
  // ...
  onNewInstance(instance) {
    trigger(aexpr(this.expression, instance))
      .onBecomeTrue(() => this.add(instance))
      .onBecomeFalse(() => this.remove(instance));
  }
}

However, by reformulating the paramerizable aexpr to a call with that exact parameter we get:

    trigger(aexpr(() => this.expression(instance)))

Can our chosen implementation strategy handle this case?
This should be true for ticking and rewriting, but not for interpretation, if the this.expression refers to locally scoped variables, as this.expression is now not called directly in the interpreter anymore! (which it was before, so it could handle this scenario due to the explicitly provided local scope object)

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

No branches or pull requests

1 participant