Mark Lawrence wrote:

    foreach my $field ($form->param) {
        my @vals = $form->param($field) or next;
        $expr    = $expr & ( @vals > 1 ? $table->$field->in(@vals)
                                       : $table->$field == $vals[0] );
    }

Mark, this is more or less what I was asking for, but it seems to reproduce what Pagaltzis was saying (except that it doesn't uses the unnecessary reduce's ;-)

Thus it leads to the same objections I told him, at least when applied to a more general case:

1. If you have both &'s and |'s in your (full) expression, how can you find the correct order to evaluate the various subexpressions?

2. This way you are evaluating the (whole) expression (binary) subexpression by subexpression, so you are basically bypassing your parser (that should be able to handle more complex logic expressions, not just binary ones, from what I understand).
Doesn't this defeat the whole logic under your module?

That's why I was talking about string concatenations to build the whole expression *before* evaluating it: though I don't like it in such a situation it's even preferable since it saves you from (pre-)parsing the expression in your code to find the correct subexpressions evaluation order (and from a series of other parsing problems).

Cheers,
Emanuele.

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to