<?xml version="1.0" encoding="windows-1252"?>
<node id="1019152" title="Re^3: getting rid of special features" created="2013-02-17 10:39:49" updated="2013-02-17 10:39:49">
<type id="11">
note</type>
<author id="616540">
moritz</author>
<data>
<field name="doctext">
&lt;blockquote&gt;actually I don't wanna get rid of the feature but of the syntax.&lt;/blockquote&gt;

&lt;p&gt;Then we are (mostly) in violent agreement.&lt;/p&gt;

&lt;p&gt;I still think that ++ being special-cased for strings is a rather harmless example, and there is another argument for keeping it: It's nicely symmetric with how ranges of strings work:

&lt;code&gt;
$ perl -wE 'say for "a".."e"'
a
b
c
d
e
&lt;/code&gt;

&lt;p&gt;which might be used a bit more often than direct increment on strings.&lt;/p&gt;

&lt;p&gt;Now that we've already having this discussion, I'd like to point out some more Perl 5 features that could be reworked to much saner:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The flipflop (.. operator in scalar context) could have its own operator, making accidental usage of ranges in scalar context much less confusing&lt;/li&gt;
  &lt;li&gt;[doc://reverse] should lose its magic dual functionality (list reversal vs. string reveral) depending on context. Perl 6 uses another function for string reversal ([http://doc.perl6.org/type/Str#flip|flip]), but other approaches are possible too.&lt;/li&gt;
  &lt;li&gt;Whitespace is allowed between sigils and the name of the variable. There's no good reason to keep that.&lt;/li&gt;
  &lt;li&gt;Indirect method call syntax. (This one is hard to remove).&lt;/li&gt;
  &lt;li&gt;The control sequences for newish regex features are really obscure and hard to remember.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But in the long run, removing cruft is only a small part of evolving Perl 5. I firmly believe that in order to stay competitive, it needs a type system(*), proper subroutine signatures and a less bare-bones OO system in core.&lt;/p&gt;

&lt;p&gt;(*) If the need for a type system isn't obvious to you, let me just tell you that at least 95% of all the character encoding trouble in Perl 5 could easily be avoided by having separate types for text strings and byte buffers.&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-616540"&gt;
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1019130</field>
<field name="parent_node">
1019142</field>
</data>
</node>
