in reply to Hints Towards Writing a Module with New Operators
The little Fortran documentation that I can find by Googling suggests that, as moritz (implicitly) points out, .EQV. is just == on Booleans. If this is correct, are you just looking to bring to Perl the syntactic beauty of Fortran :-)—or is it that you want something that does the Boolean conversion for you, so that you can write $a .EQV. $b ** as the equivalent of $a ? $b ? 1 : 0 : $b ? 0 : 1 *?
Either way, as moritz says, for adding new syntax to Perl-as-it-now-is, I think that the only options are syntax filters (struck out as I write it so that you don't even think about it) or Devel::Declare (which worries adamk).
* Or ($a && $b) || !($a || $b), I suppose. UPDATE: Ha, and maybe I'd like to write my own routines for addition while I'm at it. Thanks, JavaFan. :-)
UPDATE: ** Note that this precise syntax conflicts with string concatenation, but we shouldn't be using barewords anyway.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Hints Towards Writing a Module with New Operators
by JavaFan (Canon) on Dec 20, 2009 at 01:00 UTC | |
by BrowserUk (Patriarch) on Dec 20, 2009 at 01:03 UTC | |
by JadeNB (Chaplain) on Dec 20, 2009 at 01:13 UTC | |
by BrowserUk (Patriarch) on Dec 20, 2009 at 08:24 UTC | |
Re^2: Hints Towards Writing a Module with New Operators
by ikegami (Patriarch) on Dec 20, 2009 at 08:48 UTC | |
Re^2: Hints Towards Writing a Module with New Operators
by swampyankee (Parson) on Dec 20, 2009 at 23:14 UTC |