My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 34: introduce simple form of and() and or() operations
1 person starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  Dec 2008


 
Reported by koval...@gmail.com, Dec 24, 2008
for instance:

eq(sp.getSourceName(), sourceName).or().neq(sp.getSourceName(), "qqq")

it can be implemented as follows:

class ConditionalExpression {
  UncompleteConditionalExpression or() {
    return new UncompleteConditionalExpression(OR, this);
  }
}

UncompleteConditionalExpression {
  Operator operation;
  ConditionalExpression left;

  ConditionalExpression neq(left, right) {
    return new ConditionalExpression(operation, this.left,
      new ConditionalExpression(NEQ, left, right));
  }
}
Dec 29, 2008
Project Member #1 eric.bot...@gmail.com
As a matter of fact, I started with something similar to what you mention and 
reverted to the current way of doing. Indeed it is too complex - for a small benefit 
- to maintain context with this approach, esp. when using parentheses for grouping.


Status: WontFix

Powered by Google Project Hosting