<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Freezing or fixing a parameter at time of function definition</title>
    <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 14:30:10 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 14:30:10 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Freezing or fixing a parameter at time of function definition</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Freezing or fixing a parameter at time of function definition</title>
      <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time</link>
    </image>
    <item>
      <title>unapply and curry</title>
      <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time?ref=Feed:MaplePrimes:Freezing or fixing a parameter at time of function definition:Comments#answer123914</link>
      <itunes:summary>&lt;p&gt;The usual way to do this is with &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=unapply' target='_new'&gt;?unapply&lt;/a&gt;.&amp;nbsp; For example,&lt;/p&gt;
&lt;pre&gt;t := 3:&lt;br&gt;f := unapply(x*t, x):&lt;/pre&gt;
&lt;p&gt;However, for that to work one generally needs an expression (here x*t) to convert to a procedure.&amp;nbsp; That can be a bit tricky when, instead, you have a procedure.&amp;nbsp; One way is to use the curry procedures (?curry and &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=rcurry)' target='_new'&gt;?rcurry)&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;g := (x,y) -&amp;gt; x*y:&lt;br&gt;t := 3:&lt;br&gt;f := curry(g,t):&lt;/pre&gt;
&lt;p&gt;In the template you gave we can do&lt;/p&gt;
&lt;pre&gt;MyProcedure := proc(list_of_values)&lt;br&gt;local l_funcs;&lt;br&gt;    l_funcs := map2(curry, SomeFunction, list_of_values);&lt;br&gt;    plot(l_funcs, 0..10);&lt;br&gt;end proc:&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;The usual way to do this is with &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=unapply' target='_new'&gt;?unapply&lt;/a&gt;.&amp;nbsp; For example,&lt;/p&gt;
&lt;pre&gt;t := 3:&lt;br&gt;f := unapply(x*t, x):&lt;/pre&gt;
&lt;p&gt;However, for that to work one generally needs an expression (here x*t) to convert to a procedure.&amp;nbsp; That can be a bit tricky when, instead, you have a procedure.&amp;nbsp; One way is to use the curry procedures (?curry and &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=rcurry)' target='_new'&gt;?rcurry)&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;g := (x,y) -&amp;gt; x*y:&lt;br&gt;t := 3:&lt;br&gt;f := curry(g,t):&lt;/pre&gt;
&lt;p&gt;In the template you gave we can do&lt;/p&gt;
&lt;pre&gt;MyProcedure := proc(list_of_values)&lt;br&gt;local l_funcs;&lt;br&gt;    l_funcs := map2(curry, SomeFunction, list_of_values);&lt;br&gt;    plot(l_funcs, 0..10);&lt;br&gt;end proc:&lt;/pre&gt;</description>
      <guid>123914</guid>
      <pubDate>Sun, 17 Jul 2011 19:19:34 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>Another idea</title>
      <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time?ref=Feed:MaplePrimes:Freezing or fixing a parameter at time of function definition:Comments#answer123917</link>
      <itunes:summary>&lt;p&gt;Why not use a sequence to fill in the parameters like this:&lt;br&gt;&lt;br&gt;f:=(t,x)-&amp;gt;t*x;&lt;br&gt;&lt;br&gt;list_of_values:=[1,2,3,4]:&lt;br&gt;&lt;br&gt;plot([seq(f(list_of_values[i],x),i=1..4)],x=0..1);&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Why not use a sequence to fill in the parameters like this:&lt;br&gt;&lt;br&gt;f:=(t,x)-&amp;gt;t*x;&lt;br&gt;&lt;br&gt;list_of_values:=[1,2,3,4]:&lt;br&gt;&lt;br&gt;plot([seq(f(list_of_values[i],x),i=1..4)],x=0..1);&lt;/p&gt;</description>
      <guid>123917</guid>
      <pubDate>Sun, 17 Jul 2011 23:38:56 Z</pubDate>
      <itunes:author>Alex Smith</itunes:author>
      <author>Alex Smith</author>
    </item>
    <item>
      <title>subs</title>
      <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time?ref=Feed:MaplePrimes:Freezing or fixing a parameter at time of function definition:Comments#answer123920</link>
      <itunes:summary>&lt;p&gt;It can be done using subs.&amp;nbsp; Thus:&lt;/p&gt;
&lt;p&gt;&amp;gt; f := x -&amp;gt; x*t;&lt;br&gt;&amp;nbsp;&amp;nbsp; f3:= subs('t' = 3, eval(f));&lt;br&gt;&amp;nbsp;&amp;nbsp; t:= 4;&lt;br&gt;&amp;nbsp;&amp;nbsp; f3(x);&lt;/p&gt;
&lt;p&gt;&lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=5fbca682cb5c7b6129446a37cea18410.gif" alt="3*x"&gt;&lt;/p&gt;
&lt;p&gt;The quotes are only needed if the variable t has been assigned a value when f3 is being defined.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;It can be done using subs.&amp;nbsp; Thus:&lt;/p&gt;
&lt;p&gt;&amp;gt; f := x -&amp;gt; x*t;&lt;br&gt;&amp;nbsp;&amp;nbsp; f3:= subs('t' = 3, eval(f));&lt;br&gt;&amp;nbsp;&amp;nbsp; t:= 4;&lt;br&gt;&amp;nbsp;&amp;nbsp; f3(x);&lt;/p&gt;
&lt;p&gt;&lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=5fbca682cb5c7b6129446a37cea18410.gif" alt="3*x"&gt;&lt;/p&gt;
&lt;p&gt;The quotes are only needed if the variable t has been assigned a value when f3 is being defined.&lt;/p&gt;</description>
      <guid>123920</guid>
      <pubDate>Mon, 18 Jul 2011 03:57:07 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>premature evaluation</title>
      <link>http://www.mapleprimes.com/questions/123913-Freezing-Or-Fixing-A-Parameter-At-Time?ref=Feed:MaplePrimes:Freezing or fixing a parameter at time of function definition:Comments#comment123918</link>
      <itunes:summary>&lt;p&gt;That only works if f permits a symbolic x parameter. Consider&lt;/p&gt;
&lt;pre&gt;&amp;nbsp;f := proc(k,x) if x &amp;lt; 1 then k else -k end if end proc:&lt;br&gt;plot([seq(f(k,x),k=[1,2,3])], x=0..3);&lt;br&gt;Error, (in f) cannot determine if this expression is true or false: x &amp;lt; 1&lt;/pre&gt;
&lt;p&gt;You can delay the evaluation of f by using forward quotes:&lt;/p&gt;
&lt;pre&gt;plot([seq('f'(k,x),k=[1,2,3])], x=0..3);&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;That only works if f permits a symbolic x parameter. Consider&lt;/p&gt;
&lt;pre&gt;&amp;nbsp;f := proc(k,x) if x &amp;lt; 1 then k else -k end if end proc:&lt;br&gt;plot([seq(f(k,x),k=[1,2,3])], x=0..3);&lt;br&gt;Error, (in f) cannot determine if this expression is true or false: x &amp;lt; 1&lt;/pre&gt;
&lt;p&gt;You can delay the evaluation of f by using forward quotes:&lt;/p&gt;
&lt;pre&gt;plot([seq('f'(k,x),k=[1,2,3])], x=0..3);&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>123918</guid>
      <pubDate>Mon, 18 Jul 2011 00:35:10 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
  </channel>
</rss>