Yesterday Aaron Crane wrote:

> Jonathan Scott Duff writes:
>
> >     @a `+ @b
>
> In my experience, many people actually don't get the backtick
> character at all.

Yes.  I think that might be a good reason _for_ using backtick in vector
operators:

  * Backticks aren't used in any other operators, so they would not be
    mistaken for xor nor arrays.

    Backticks also look a little odd, so even if it isn't intuitive as
    to what is going on, somebody seeing a vector op for the first time
    should at least spot that _something_ different is happening.

  * People starting out in Perl wouldn't want to use vector ops straight
    away (there are enough other things to be learning).  So a character
    that involves 'advanced' typing is used for an 'advanced' feature.

A pair of backticks could be used if the vector-equals distinction is
required:

  @a `+`= @b;
  @a `+=` @b;

> I always hate teaching people what backticks do -- not because the
> concept is difficult, but because the syntax is so alien to so many
> people.  So I teach qx// for Perl, and $() for Unix shell, and I throw
> in backticks as an extra 'you might also see this' affair.

I don't think backticks for vector conflicts with backticks for
invoking a shell (cos the latter is a term not an op), I'd be in favour
of removing the current backtick behaviour anyway:

  * It looks like quoting, and it isn't really.  It's more like a
    function call.

  * Many people use backticks when C<system()> is desired.  The fact
    that these two similar features look so different from each other us
    confusing.

Also, if backticks were to be used for vector ops then removing the
existing use would mean that backticks are _only_ for vector ops.  No
'small exceptions' -- the very simple rule that backticks are always
vector ops.

> Anyway, that was a bit of a rant, but what I mean is: I'd actually be
> in favour of avoiding backtick entirely in operators.

I can see where you're coming from there.  They are an awkward glyph.
But Larry's short enough of characters as it is: I don't think we can
afford to throw one away entirely, however unpleasant it is.

Smylers

Reply via email to