<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Expression vs. Functions in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74925#M35878</link>
    <description>&lt;P&gt;Thank you Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started a new topic based on the information you were able to provide. Functions are&amp;nbsp;definitely what i needed to understand as it significantly reduces the lines of code in my data pull script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link &lt;A href="https://community.jmp.com/t5/Discussions/How-to-loop-using-a-function/m-p/74841" target="_blank"&gt;https://community.jmp.com/t5/Discussions/How-to-loop-using-a-function/m-p/74841&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 15:51:22 GMT</pubDate>
    <dc:creator>Yngeinstn</dc:creator>
    <dc:date>2018-09-21T15:51:22Z</dc:date>
    <item>
      <title>Expression vs. Functions</title>
      <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74605#M35822</link>
      <description>&lt;P&gt;I been struggling to understand the differences. It looks to me, at least on the surface that they accomplish the same thing but seeing how you get to choose there is a difference somewhere. If you fine folks wouldn't mind giving me the dumb downed explination with maye an example or two i would greatly appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 10:34:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74605#M35822</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2018-09-20T10:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Expression vs. Functions</title>
      <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74653#M35837</link>
      <description>&lt;P&gt;My take: Functions are for code that will be recurring.&amp;nbsp; Expressions are for inserting code into other code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a simplified example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

onewayFunc = function({dt,Yaxis, Xaxis}, {Default Local},
	plot = dt &amp;lt;&amp;lt; Oneway(
		Y( eval(Yaxis) ),
		X( eval(Xaxis) )
	);
	return(plot);
);
Yaxis = expr({Column("height"), Column("weight")});
Xaxis = expr(Column("sex"));
onewayFunc(dt,Yaxis,Xaxis);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code could be accomplished without expressions, but using it as an example.&amp;nbsp; In general I would say always use functions, until you meet an edge case where an expression will get the job done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expressions also have several useful helper functions making them useful for arithmatic and alegebra:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Simplify Expr( Expr( 2 * 3 * a + b * (a + 3 - c) - a * b ) );
//6 * a + 3 * b + -1 * b * c&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Sep 2018 15:15:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74653#M35837</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2018-09-20T15:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Expression vs. Functions</title>
      <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74683#M35846</link>
      <description>&lt;P&gt;Thank you for the information. I have 6+ include() scripts that are nothing but Expressions.. I am going to try the function now..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 17:34:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74683#M35846</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2018-09-20T17:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Expression vs. Functions</title>
      <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74895#M35876</link>
      <description>&lt;P&gt;In addition to using the dynamic nature of expressions, I see expressions as another way to make a subroutine. I could use a function or an expression as a subroutine. I prefer an expression when I want to delay evaluation, don't need parameters, and don't need a result returned. I prefer a user function when I need parameters or a return result.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 14:51:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74895#M35876</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2018-09-21T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Expression vs. Functions</title>
      <link>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74925#M35878</link>
      <description>&lt;P&gt;Thank you Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started a new topic based on the information you were able to provide. Functions are&amp;nbsp;definitely what i needed to understand as it significantly reduces the lines of code in my data pull script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link &lt;A href="https://community.jmp.com/t5/Discussions/How-to-loop-using-a-function/m-p/74841" target="_blank"&gt;https://community.jmp.com/t5/Discussions/How-to-loop-using-a-function/m-p/74841&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 15:51:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Expression-vs-Functions/m-p/74925#M35878</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2018-09-21T15:51:22Z</dc:date>
    </item>
  </channel>
</rss>

