<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Write procedures which return procedures itself?</title>
    <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 18:00:51 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 18:00:51 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Write procedures which return procedures itself?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Write procedures which return procedures itself?</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself</link>
    </image>
    <item>
      <title>Would someone please correct</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#answer44324</link>
      <itunes:summary>&lt;p&gt;Would someone please correct my grammar error (s/itself/themselve) and delete this post?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Would someone please correct my grammar error (s/itself/themselve) and delete this post?&lt;/p&gt;</description>
      <guid>44324</guid>
      <pubDate>Sun, 07 Mar 2010 16:44:06 Z</pubDate>
      <itunes:author>848380</itunes:author>
      <author>848380</author>
    </item>
    <item>
      <title>example</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#answer44325</link>
      <itunes:summary>&lt;pre&gt;
(**) f := k -&amp;gt; x -&amp;gt; k*x:
(**) g := f(3):
(**) g(a); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 a

The proc form is more general.&amp;nbsp; It permits multiple statements and optional arguments.
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;pre&gt;
(**) f := k -&amp;gt; x -&amp;gt; k*x:
(**) g := f(3):
(**) g(a); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 a

The proc form is more general.&amp;nbsp; It permits multiple statements and optional arguments.
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>44325</guid>
      <pubDate>Sun, 07 Mar 2010 21:36:43 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>First of all, thank you, and</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#answer44326</link>
      <itunes:summary>&lt;p&gt;First of all, thank you, and second:&lt;br /&gt;
Why doesn't &lt;br /&gt;
f := x -&amp;gt; if x &amp;lt;= 0 then 0 else 1 end if;&lt;br /&gt;
work?&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; I just found out that &lt;br /&gt;
if(x &amp;lt;= 0, 0, 1);&lt;br /&gt;
works, but it's not the same and I fear that this expression could diverge in some cases, in case all subexpressions of it are evaluated no matter what case applies. In the above situation only the corresponding subexpression would be evaluated I guess, not all at once so the danger of a diverging expression would be smaller.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;First of all, thank you, and second:&lt;br /&gt;
Why doesn't &lt;br /&gt;
f := x -&amp;gt; if x &amp;lt;= 0 then 0 else 1 end if;&lt;br /&gt;
work?&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; I just found out that &lt;br /&gt;
if(x &amp;lt;= 0, 0, 1);&lt;br /&gt;
works, but it's not the same and I fear that this expression could diverge in some cases, in case all subexpressions of it are evaluated no matter what case applies. In the above situation only the corresponding subexpression would be evaluated I guess, not all at once so the danger of a diverging expression would be smaller.&lt;/p&gt;</description>
      <guid>44326</guid>
      <pubDate>Mon, 08 Mar 2010 02:38:42 Z</pubDate>
      <itunes:author>848380</itunes:author>
      <author>848380</author>
    </item>
    <item>
      <title>Well it tells me
"Error,</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#answer44328</link>
      <itunes:summary>&lt;p&gt;Well it tells me&lt;br /&gt;
&amp;quot;Error, invalid arrow procedure&amp;quot;&lt;br /&gt;
and I'm typing exactly the same as you did?&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; I just found out the reason why: When changing to Maple input from 2D Output, it suddenly works, but why?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Well it tells me&lt;br /&gt;
&amp;quot;Error, invalid arrow procedure&amp;quot;&lt;br /&gt;
and I'm typing exactly the same as you did?&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; I just found out the reason why: When changing to Maple input from 2D Output, it suddenly works, but why?&lt;/p&gt;</description>
      <guid>44328</guid>
      <pubDate>Mon, 08 Mar 2010 02:52:57 Z</pubDate>
      <itunes:author>848380</itunes:author>
      <author>848380</author>
    </item>
    <item>
      <title>Why do you say it doesn't</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#comment44327</link>
      <itunes:summary>&lt;p&gt;Why do you say it doesn't work?&amp;nbsp; Using command-line maple I get&lt;/p&gt;
&lt;pre&gt;
(**) f := x -&amp;gt; if x &amp;lt;= 0 then 0 else 1 end if;
(**) f(2);                         
                                   1
(**) f(0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
                                   0
(**) f(-1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Why do you say it doesn't work?&amp;nbsp; Using command-line maple I get&lt;/p&gt;
&lt;pre&gt;
(**) f := x -&amp;gt; if x &amp;lt;= 0 then 0 else 1 end if;
(**) f(2);                         
                                   1
(**) f(0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
                                   0
(**) f(-1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0
&lt;/pre&gt;</description>
      <guid>44327</guid>
      <pubDate>Mon, 08 Mar 2010 02:44:37 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>parser difference</title>
      <link>http://www.mapleprimes.com/questions/35571-Write-Procedures-Which-Return-Procedures-Itself?ref=Feed:MaplePrimes:Write procedures which return procedures itself?:Comments#comment44329</link>
      <itunes:summary>&lt;p&gt;This is the first parser difference I mention &lt;a href="http://www.mapleprimes.com/blog/acer/parserdifferences"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;This is the first parser difference I mention &lt;a href="http://www.mapleprimes.com/blog/acer/parserdifferences"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>44329</guid>
      <pubDate>Mon, 08 Mar 2010 03:11:06 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>