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

[JEXL] Implement short-circuit boolean evaluation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • Operating System: All
      Platform: All

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: