<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Perl 6: WITCH plus]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?witch_plus</link>
<description></description>
<pubDate>Sun, 01 Mar 2009 12:01:31 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[WITCH plus]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?witch_plus</link>
<description><![CDATA[<div class="wiki">
<h1 id="mnemonics">Mnemonics</h1>
<p>
 &quot;positive&quot;, &quot;number&quot;, &quot;add&quot;</p>
<p>
 -- usage is very intuitive<br />
 -- does not have the &quot;required&quot; meaning one may be used to (instead that is ! <a href="http://www.perlfoundation.org/perl6/index.cgi?witch_bang" title="(64 months)  Mnemonics not , nvert , mportant , nternal , ouch  most of the time is used to invert, negate, and ...">bang<!-- wiki-renamed-link WITCH bang --></a>)</p>
<hr />
<h1 id="used_alone">Used alone</h1>
<p>
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> along with - <a target="_blank" title="(external link)" href="http://www.oreillynet.com/onlamp/blog/2007/09/yap6_operator_coercion_operato.html">coerces to type Num<!-- wiki-renamed-hyperlink "coerces to type Num"<http://www.oreillynet.com/onlamp/blog/2007/09/yap6_operator_coercion_operato.html> --></a><br />
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> As an infix operator: adds numbers</p>
<h1 id="operators_containing_this_character">Operators containing this character</h1>
<p>
<span class="nlw_phrase">++<!-- wiki: {{++}} --></span> <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S03.html#Autoincrement_precedence">pre and post increment<!-- wiki-renamed-hyperlink "pre and post increment"<http://perlcabal.org/syn/S03.html#Autoincrement_precedence> --></a> as in common parlance (which means use it like you would expect)<br />
<span class="nlw_phrase">+^ +| +&amp;<!-- wiki: {{+^ +| +&amp;}} --></span> <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S03.html#Additive_precedence">bitwise logical operations<!-- wiki-renamed-hyperlink "bitwise logical operations"<http://perlcabal.org/syn/S03.html#Additive_precedence> --></a> on buffers or strings<br />
<span class="nlw_phrase">+=<!-- wiki: {{+=}} --></span> the post-assignment <a target="_blank" title="(external link)" href="http://www.oreillynet.com/onlamp/blog/2007/12/yap6_operator_mutating_operato_1.html">mutant<!-- wiki-renamed-hyperlink "mutant"<http://www.oreillynet.com/onlamp/blog/2007/12/yap6_operator_mutating_operato_1.html> --></a> form of +</p>
<p>
<span class="nlw_phrase">.++<!-- wiki: {{.++}} --></span> post increment dotted form (used like a method)<br />
<span class="nlw_phrase">.:&lt;++&gt;<!-- wiki: {{.:&lt;++&gt;}} --></span> pre increment dotted form (used like a method)<br />
<span class="nlw_phrase">[+]<!-- wiki: {{[+]}} --></span> not special sugar but will be often seen: reduce operator that sums a list</p>
<h1 id="when_used_inside_regexes">When used inside regexes</h1>
<p>
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> ans +? still mean <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#Unchanged_syntactic_features">one or more<!-- wiki-renamed-hyperlink "one or more"<http://perlcabal.org/syn/S05.html#Unchanged_syntactic_features> --></a><br />
<span class="nlw_phrase">+:<!-- wiki: {{+:}} --></span> is the same but prevents <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#Regexes_are_now_first-class_language%2C_not_strings">panicked backtracking<!-- wiki-renamed-hyperlink "panicked backtracking"<http://perlcabal.org/syn/S05.html#Regexes_are_now_first=-class_language%2C_not_strings> --></a> <br />
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> at the opening of a character class is unecessary but can be <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#Extensible_metasyntax_(%3C...%3E)">used for clarity<!-- wiki-renamed-hyperlink "used for clarity"<http://perlcabal.org/syn/S05.html#Extensible_metasyntax_(%3C...%3E)> --></a> the same as -<br />
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#Extensible_metasyntax_(%3C...%3E)">between character classes<!-- wiki-renamed-hyperlink "between character classes"<http://perlcabal.org/syn/S05.html#Extensible_metasyntax_(%3C...%3E)> --></a> combines them if the character class started with + or -</p>
<h1 id="other_uses">Other Uses</h1>
<p>
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> has wildcard uses in <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S02.html#Literals">version literals<!-- wiki-renamed-hyperlink "version literals"<http://perlcabal.org/syn/S02.html#Literals> --></a><br />
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> before a flag on the commandline results in special values in a <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S06.html#Declaring_a_MAIN_subroutine">MAIN subroutine<!-- wiki-renamed-hyperlink "MAIN subroutine"<http://perlcabal.org/syn/S06.html#Declaring_a_MAIN_subroutine> --></a></p>
<p>
<span class="nlw_phrase">[+*]<!-- wiki: {{[+*]}} --></span> finds the <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S09.html#Negative_and_differential_subscripts">next empty slot<!-- wiki-renamed-hyperlink "next empty slot"<http://perlcabal.org/syn/S09.html#Negative_and_differential_subscripts> --></a> at the end of the array which is not special sugar but worth noting.<br />
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> is a <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S26.html">border intersection<!-- wiki-renamed-hyperlink "border intersection"<http://perlcabal.org/syn/S26.html> --></a> in POD</p>
<h1 id="obselete_deprecated_or_other_language_uses">Obselete, deprecated or other language uses</h1>
<p>
<span class="nlw_phrase">+<!-- wiki: {{+}} --></span> was replaced as a twigil by * to indicate a <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S02.html#Names">contextually scoped variable<!-- wiki-renamed-hyperlink "contextually scoped variable"<http://perlcabal.org/syn/S02.html#Names> --></a></p>
</div>
]]></description>
<author>Samuel Harrington</author>
<guid isPermaLink="true">http://www.perlfoundation.org/perl6/index.cgi?witch_plus</guid>
<pubDate>Sun, 01 Mar 2009 12:01:31 -0000</pubDate>
</item>

</channel>
</rss>