protected boolean eval(IEvaluationContext context, Expr a, boolean strict)
            throws ExprException {
        if (a == null)
            return false;

        if (a instanceof ExprEvaluatable) {
            a = ((ExprEvaluatable) a).evaluate(context);
        }

        if (a instanceof ExprNumber) {
            return ((ExprNumber) a).booleanValue();
        }

        if (a instanceof ExprMissing)
            return false;

        if (a instanceof ExprArray) {
            ExprArray arr = (ExprArray) a;
            int rows = arr.rows();
            int cols = arr.columns();
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < cols; j++) {
                    if (eval(context, arr.get(i, j), false))
                        return true;
                }
            }
        }

        if (strict)
            throw new ExprException("Unexpected argument to " +
                    getClass().getSimpleName() + ": " + a);

        return false;
    }