<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tzelon Machluf</title>
    <description>The latest articles on DEV Community by Tzelon Machluf (@tzelon).</description>
    <link>https://dev.to/tzelon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F107851%2F01b54fd2-88b0-4990-a4ff-22ec9ebe2589.jpeg</url>
      <title>DEV Community: Tzelon Machluf</title>
      <link>https://dev.to/tzelon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tzelon"/>
    <language>en</language>
    <item>
      <title>Three Ways to Start an Elixir Program</title>
      <dc:creator>Tzelon Machluf</dc:creator>
      <pubDate>Fri, 18 Oct 2019 11:43:13 +0000</pubDate>
      <link>https://dev.to/tzelon/three-ways-to-start-an-elixir-program-5cfo</link>
      <guid>https://dev.to/tzelon/three-ways-to-start-an-elixir-program-5cfo</guid>
      <description>&lt;h3&gt;
  
  
  The &lt;code&gt;elixir&lt;/code&gt; command used to run a single Elixir source file.
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;elixir&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you run this command two things happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The file source.ex is compiled in-memory, and the resulting modules are loaded to the VM.&lt;/li&gt;
&lt;li&gt;Every code outside of a module is executed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;mix&lt;/code&gt; tool
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mix&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you want to run a project created by &lt;code&gt;mix&lt;/code&gt; (&lt;code&gt;mix new project_name&lt;/code&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;iex&lt;/code&gt; Elixir's interactive shell.
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mix&lt;/span&gt; &lt;span class="n"&gt;my_source_file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you want to load a module to the VM in interactive mode. &lt;br&gt;
&lt;strong&gt;Note that code outside of the module will not be executed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also use &lt;code&gt;mix&lt;/code&gt; and run a project and load the interactive shell with &lt;code&gt;iex -S mix run&lt;/code&gt;&lt;/p&gt;

</description>
      <category>elixir</category>
    </item>
    <item>
      <title>Recompile Elixir Module in iex</title>
      <dc:creator>Tzelon Machluf</dc:creator>
      <pubDate>Fri, 18 Oct 2019 11:04:49 +0000</pubDate>
      <link>https://dev.to/tzelon/recompile-elixir-module-in-iex-5gp9</link>
      <guid>https://dev.to/tzelon/recompile-elixir-module-in-iex-5gp9</guid>
      <description>&lt;p&gt;When you want to view your changes for a module &lt;code&gt;iex&lt;/code&gt; can recompile it on the fly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loading a source file with MyModule
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;iex&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;your&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Recompile the module's source file
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="no"&gt;MyModule&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>elixir</category>
      <category>iex</category>
    </item>
  </channel>
</rss>
