On Tue, May 27, 2014 at 11:23 AM, Brandon Myers <notifications@github.com>wrote:

> In raco/expression/expression.py:
>
> > @@ -553,3 +553,34 @@ def __str__(self):
> >
> >      def __repr__(self):
> >          return self.__str__()
> > +
> > +
> > +import boolean
> > +import abc
> > +
> > +
> > +class ExpressionVisitor(boolean.BooleanExprVisitor):
>
>
>    1. I'm actually not sure why the concept of a boolean expression
>    should even exist; I think I will get rid of it. In PL there is the
>    analogous question of embedding types in your syntax vs making an
>    orthogonal type checking semantics. I think orthogonal is usually the right
>    answer and makes more sense here.
>
>
This seems fine, but we should make sure the typechecking happens.  A
boolean expression is "special" in a query language since it can be used as
a predicate and is therefore a much more common case.  It would be good to
make sure bugs like

A(x) :- R(x,y), y+1

get caught early as syntax errors and have clear error messages like "y+1
is not a boolean expression"


>
>    1. I will leave a comment in the visitor
>
> inheritance in this direction made sense if BoolExprVisitor supports only
> a subset of ExprVisitor methods, but I realize BoolExprVisitor really needs
> to support visitation of all expressions: thus comment 1
>




> —
> Reply to this email directly or view it on GitHub<https://github.com/uwescience/raco/pull/209/files#r13093255>
> .
>