in reply to Re: Noble DOT vs the Allmighty ARROW
in thread Noble DOT vs the Allmighty ARROW

Not to be picky (because I might be terribly wrong), but I believe the actual concatenation operator is space underscore space.

So, BUU's code would change from:

blah blah"_$d->func_"somestuff";
to
blah blah" _ $d->func _ "somestuff";
Minor change, I know. But, I really don't like the change of the concatenation operator. (I am just hoping I am remembering the Apocolypses correctly. UPDATE: I did remember correctly. Here, he talks about whitespace surrounding operators.)

And, I use the dot for string concatenation a lot too, BUU. I wish it weren't changing.

Back To Lurking,
Jeremy

Replies are listed 'Best First'.
Re: Re: Re: Noble DOT vs the Allmighty ARROW
by shotgunefx (Parson) on May 09, 2002 at 09:20 UTC
    I don't like it either. But on the plus side, you will be able to use the hyper concantenation operator.
    print _("Blah blah",$d->func,"somewhat");
    When perl6 makes it's debut, I will probably use this form exclusively. It's too hard to tell at a glance between $foo_bar and $foo _ bar on my screen.

    -Lee

    "To be civilized is to deny one's nature."
      Nifty, I didn't know about _(). Although the example might be better put
      $string = _("Blah blah",$d->func,"somewhat");
      since
      print "Blah blah ", $d->func, " somewhat";
      works today. What I am worried about is not $foo_bar vs $foo _ $bar but rather the later vs $foo - $bar. When we used the . operator a mis-shift would result in $foo > $bar which is easily seen even when you are skimming code.
        Duh. You're right, bad example.

        -Lee

        "To be civilized is to deny one's nature."
Re^3: Noble DOT vs the Allmighty ARROW
by tadman (Prior) on May 09, 2002 at 08:26 UTC
    Just think of how much this is going to cost in terms of Perl Golf characters. At the same time, though, aren't they running out of punctuation-type character operators found on the regular 104-key keyboard?

    It is odd that period is used as an operator at all, really. Syntax wise, the fact that a scalar is both a string and a number complicates things somewhat. Still, why not something more abstract? Here's some useless ideas:
    $foo = $bar:$nuu; # Currently meaningless $foo = $bar'$nu; # Ye-olde ' operator? $foo = $bar<->$nu; # Maybe? $foo = $bar$nu; # Or nothing at all? $foo = $bar $nu; # Implied? $foo = $bar~$nu; # Getting kind of crazy with overloading
    Still, this "space underscore space" stuff smells of Python-like schenannigans.

    I'm half-inclined to start a campaign to develop an alternative.
      $foo = $bar:$nuu;    # Currently meaningless
      I really don't want to have to try and parse
      $concated = $x < $y ? $x:$y : $y:$x;
      I think the ' _ ' operator is ugly, but not that bad. In general I don't think there will be much call for it in the future since we will be able to say things like
      $string = "for $x + $y the answer is $($x+$y)\n";
      instead of
      $string = "for $x + $y the answer is " . ($x+$y) . "\n";