Interesting. Perl has a legacy of putting modifiers afterwards, unlike many contemporary languages:

foo($x,$y) if verbose; $handle= open($fname) or die;

But the if can certainly be written first, also. If an operator were being programmed/adjusted by setting contextual variables, then you would have to put those first.

$+case_sensitive = False; if $name1 gt $name2 { ...
Using ordinary function call syntax, the recommendation is to put the positional parameters first and the named parameters last, but you don't have to.

You could write a macro to put operator adverbs first, using a keyword or something. That would be consistant with the syntax for 'if' used as a statement, and with 'given'. Something like: under :authority<AKC> { if $fido after $scooter { ... } }

Ah, but that moves it out from the whole statement, not still attached to the expression. I'm sure some syntax could be devised. If you want to continue to muse about it, I'll collect it as a use case for what macros need to be capable of, and will try it as an example when that part is being fleshed out.

—John


In reply to Re^2: my new article, "A Romp Through Infinity" by John M. Dlugosz
in thread my new article, "A Romp Through Infinity" by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.