We need a way to mix eq, the things to be compared, and the operation
to be done on them before they are compared:

  lc{  $foo eq $bar   }

  $foo eq (lc) $bar

  $foo eq{lc} $bar

None of those are like any existing syntax in Perl.  The current way:

  lc($foo) eq lc($bar)

seems fine in comparison.

I'd say this argues for the parser to be told about new infix operators:

  use operator
    'eqi' => 'infix';

  $blah eqi $bork
  # rewritten as eqi($blah,$bork)

This raises another issue, though:

You'd obviously want to have a module that collected together your
favourite new operators.  But if they were lexically scoped, they'd
be lexically scoped to the module they were defined in, i.e. your
collection rather than your main program.  We're going to have to
think of a way to consistently say "do this in my caller's lexical
scope" without it becoming a nasty upvar hell.

Nat

Reply via email to