Skip to content

Commit 74403a6

Browse files
committed
enables short circuiting for boolean ops
1 parent e44743a commit 74403a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common/BooleanOps.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ trait LiftBoolean {
1212

1313
trait BooleanOps extends Variables {
1414
def infix_unary_!(x: Rep[Boolean])(implicit pos: SourceContext) = boolean_negate(x)
15-
def infix_&&(lhs: Rep[Boolean], rhs: Rep[Boolean])(implicit pos: SourceContext) = boolean_and(lhs,rhs)
16-
def infix_||(lhs: Rep[Boolean], rhs: Rep[Boolean])(implicit pos: SourceContext) = boolean_or(lhs,rhs)
15+
def infix_&&(lhs: Rep[Boolean], rhs: =>Rep[Boolean])(implicit pos: SourceContext) = boolean_and(lhs,rhs)
16+
def infix_||(lhs: Rep[Boolean], rhs: =>Rep[Boolean])(implicit pos: SourceContext) = boolean_or(lhs,rhs)
17+
18+
// TODO: short-circuit by default
1719

1820
def boolean_negate(lhs: Rep[Boolean])(implicit pos: SourceContext): Rep[Boolean]
1921
def boolean_and(lhs: Rep[Boolean], rhs: Rep[Boolean])(implicit pos: SourceContext): Rep[Boolean]

0 commit comments

Comments
 (0)