<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'Side effect' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/27/topics/298</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>Side effect posted by Alain O'Dea @ Wed, 02 Apr 2008 02:57:18 -0000</title>
      <description>&lt;p&gt;My understanding (Joe, correct me if I am wrong), is that the term Side effect is used in the book to mean anything that alters state outside of the current function being executed.&lt;/p&gt;


	&lt;p&gt;All Variables in Erlang are either bound or unbound. Once bound through matching in an expression an Erlang Variable cannot be changed. What appears to be an assignment operator (the &amp;#8221;=&amp;#8221; sign) is in actual fact a constraint expression declaring the left and right hand sides of the expression to be equal.&lt;/p&gt;


	&lt;p&gt;Writing X = 1 followed by X = 2 will fail on X = 2 because X has already been constrained to equal 1 by X = 1. This pattern matching mechanism requires rethinking the design of state and variables in a program. &lt;span class="caps"&gt;IMHO&lt;/span&gt;, the end result is more comprehensible code that is easier to reason about and explain to others.&lt;/p&gt;


	&lt;p&gt;In Erlang an expression cannot directly modify the state of another function or even other expressions in the same scope. All such modifications are explicitly made through the interpretation of messages or function parameters. By Chapter 3 you have not gotten to see Message Passing or Concurrency. It should hopefully be clearer at that point.&lt;/p&gt;


	&lt;p&gt;I check this board frequently so please post your questions here. I will do my best to help :)&lt;/p&gt;</description>
      <pubDate>Wed, 02 Apr 2008 02:57:18 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:27:298:2522</guid>
      <author>Alain O'Dea</author>
      <link>http://forums.pragprog.com/forums/27/topics/298</link>
    </item>
    <item>
      <title>Side effect posted by Alexey Kuznetsov @ Thu, 06 Mar 2008 22:41:10 -0000</title>
      <description>&lt;p&gt;I already finish 3 chapters, but still don&amp;#8217;t understand what mean that expression? I know only side effect in C++ or other imperative languages.&lt;/p&gt;</description>
      <pubDate>Thu, 06 Mar 2008 22:41:10 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:27:298:2395</guid>
      <author>Alexey Kuznetsov</author>
      <link>http://forums.pragprog.com/forums/27/topics/298</link>
    </item>
  </channel>
</rss>
