Yea, I used to dread the idea of using ~ for concat. However, Perl6 does have string interp. In addition, Perl6's string interp. will be even more powerfull than 5's. So, we may find ourselves using ~ less often than we might think.
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
| [reply] [d/l] |
Also, ~ will be used to introduce string context too. So it may take a while, but first or later we will all get used to associate it to strings...
| [reply] [d/l] |
There are still many ways to avoid needing the tilde. There will be normal interpolation as in Perl 5 ("$foo$bar") but new is interpolation of closures ("int($baz) = { int($baz) }", resulting in something like int(5.6) = 5). There is also sprintf, now know as "as" ([$foo, $bar].as("%s%s") or maybe also "%s%s".as($foo, $bar), which may not make sense at first, but will make sense when written as as "%s%s": $foo, $bar).
Personally I don't find ~ hard to type, and I absolutely love its place in Perl 6, not only as the string concatenation operator, but also as the string context operator and the stringy semi-meta operator in bit operators.
| [reply] |
Yikes, I didn't know they were changing so many basic things! I'm officially scared of Perl 6 now. That tilde just seems extremely unintuitive. I'm worried Perl 6 might be going the Python route and trying too hard to be different from every other language. | [reply] |