<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, how to write procedures that use go to in Maple</title>
    <link>http://www.mapleprimes.com/questions/99052-How-To-Write-Procedures-That-Use-Go-To-In-Maple</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 22:01:21 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 22:01:21 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, how to write procedures that use go to in Maple</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, how to write procedures that use go to in Maple</title>
      <link>http://www.mapleprimes.com/questions/99052-How-To-Write-Procedures-That-Use-Go-To-In-Maple</link>
    </image>
    <item>
      <title>goto</title>
      <link>http://www.mapleprimes.com/questions/99052-How-To-Write-Procedures-That-Use-Go-To-In-Maple?ref=Feed:MaplePrimes:how to write procedures that use go to in Maple:Comments#answer99054</link>
      <itunes:summary>&lt;p&gt;Maple does actually have a&lt;strong&gt; goto&lt;/strong&gt;.&amp;nbsp; For example:&lt;br&gt;&lt;br&gt;&amp;gt; F:= proc(x)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x = 2 then goto(b) end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y:= 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end proc;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think most of the goto's in Knuth can be replaced by judicious use of &lt;strong&gt;do&lt;/strong&gt; loops together with&lt;strong&gt; break&lt;/strong&gt;, &lt;strong&gt;next&lt;/strong&gt; and &lt;strong&gt;return&lt;/strong&gt;.&amp;nbsp; There are tricky cases, however, such as if you're in a triply nested loop and you want to break out of the two inner loops.&lt;/p&gt;
&lt;p&gt;There isn't a &lt;strong&gt;case&lt;/strong&gt; or &lt;strong&gt;switch&lt;/strong&gt; statement in Maple.&amp;nbsp;&amp;nbsp; Instead, you can use&lt;/p&gt;
&lt;p&gt;if ... then ...&lt;br&gt;elif ... then ...&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;else ...&lt;/p&gt;
&lt;p&gt;end if&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Maple does actually have a&lt;strong&gt; goto&lt;/strong&gt;.&amp;nbsp; For example:&lt;br&gt;&lt;br&gt;&amp;gt; F:= proc(x)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x = 2 then goto(b) end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y:= 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end proc;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think most of the goto's in Knuth can be replaced by judicious use of &lt;strong&gt;do&lt;/strong&gt; loops together with&lt;strong&gt; break&lt;/strong&gt;, &lt;strong&gt;next&lt;/strong&gt; and &lt;strong&gt;return&lt;/strong&gt;.&amp;nbsp; There are tricky cases, however, such as if you're in a triply nested loop and you want to break out of the two inner loops.&lt;/p&gt;
&lt;p&gt;There isn't a &lt;strong&gt;case&lt;/strong&gt; or &lt;strong&gt;switch&lt;/strong&gt; statement in Maple.&amp;nbsp;&amp;nbsp; Instead, you can use&lt;/p&gt;
&lt;p&gt;if ... then ...&lt;br&gt;elif ... then ...&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;else ...&lt;/p&gt;
&lt;p&gt;end if&lt;/p&gt;</description>
      <guid>99054</guid>
      <pubDate>Wed, 17 Nov 2010 05:53:52 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>old post</title>
      <link>http://www.mapleprimes.com/questions/99052-How-To-Write-Procedures-That-Use-Go-To-In-Maple?ref=Feed:MaplePrimes:how to write procedures that use go to in Maple:Comments#answer99056</link>
      <itunes:summary>&lt;p&gt;There's some interesting bits to be seen in &lt;a href="http://www.mapleprimes.com/questions/39028-Switchcase"&gt;this&lt;/a&gt; old (2008) post on the topic.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;There's some interesting bits to be seen in &lt;a href="http://www.mapleprimes.com/questions/39028-Switchcase"&gt;this&lt;/a&gt; old (2008) post on the topic.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>99056</guid>
      <pubDate>Wed, 17 Nov 2010 08:17:23 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Considered Harmful</title>
      <link>http://www.mapleprimes.com/questions/99052-How-To-Write-Procedures-That-Use-Go-To-In-Maple?ref=Feed:MaplePrimes:how to write procedures that use go to in Maple:Comments#comment99109</link>
      <itunes:summary>&lt;p&gt;I would not recommend using Maple's goto.&amp;nbsp; It is not documented and none of the code shipped with Maple uses it for a very good reason: it is very inefficient.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I would not recommend using Maple's goto.&amp;nbsp; It is not documented and none of the code shipped with Maple uses it for a very good reason: it is very inefficient.&lt;/p&gt;</description>
      <guid>99109</guid>
      <pubDate>Fri, 19 Nov 2010 03:25:11 Z</pubDate>
      <itunes:author>John May</itunes:author>
      <author>John May</author>
    </item>
  </channel>
</rss>