Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-12

[JEXL] Implement short-circuit boolean evaluation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      29550

      Description

      The current implementation of ASTAndNode and ASTOrNode will evaluation both
      sides of an expression before returning a result. I think most developers
      these days seem to expect the RHS of an AND/OR expression to be ignored if the
      LHS is sufficient to determine the result
      (e.g. if A=>true, "A or B"=>true, regardless of B).

      The patches appear to be trivial - if a committer is interested & thinks it
      worthwhile I'll create them.

      (btw, the old Turbo Pascal compiler described this optimisation as "short
      circuit boolean evaluation"; I'm not sure if that is a common name for it.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              commons-dev@matthew.matera.net.au Matthew Firth
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: