Re: Re: Noble DOT vs the Allmighty ARROW
by lachoy (Parson) on May 08, 2002 at 04:27 UTC
|
You must not have heard all the lame whining (online and otherwise) about how people just couldn't stand using new syntax, that it would spoil Perl forever, etc. I'm just annoyed by all that and I probably shouldn't have even replied :-) I love Perl, but that doesn't mean I never expect it to change. Dairy Queen dipcones, on the other hand...
BTW, it's lachoy. If you're curious who lachoy is, bow down before the great and powerful one.
Chris
M-x auto-bs-mode
| [reply] |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Re: Re: Noble DOT vs the Allmighty ARROW
by enoch (Chaplain) on May 08, 2002 at 14:44 UTC
|
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 | [reply] [d/l] [select] |
|
|
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." | [reply] [d/l] |
|
|
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. | [reply] [d/l] [select] |
|
|
|
|
| [reply] [d/l] |
|
|
$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";
| [reply] [d/l] [select] |
Re: Re: Noble DOT vs the Allmighty ARROW
by cowens (Beadle) on May 08, 2002 at 15:57 UTC
|
It is not just underscore; it is ' _ '. So your string would look like "blah blah" _ $d->func _ "somestuff". Not a big diff. My biggest gripe with it is that I know I am going to wind up typing "blah blah" - $d->func _ "somestuff" and wondering why I print 0somesutff. But it looks like I will be able to say "blah blah $($d->func) somestuff" which avoids the problem and looks nicer to me anyways. | [reply] [d/l] [select] |