<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Blog Entry, Thread Safety</title>
    <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety</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 20:17:33 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 20:17:33 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Blog Entry, Thread Safety</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Blog Entry, Thread Safety</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety</link>
    </image>
    <item>
      <title>prompt</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63064</link>
      <itunes:summary>&lt;p&gt;The &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=comment&amp;amp;term=comment"&gt;?comment&lt;/a&gt; help-page read from the Standard GUI of Maple 13 mentions the use of multi-line comments. The ?comment help-page available in the commandline (and Classic?) interfaces does not mention it.&lt;/p&gt;
&lt;p&gt;Setting up one's Maple prompt to be the empty comment (**) in the commandline interface is neat. It allows one to copy the entire text of input &lt;i&gt;including the prompt&lt;/i&gt; and then insert it as runnable code.&lt;/p&gt;
&lt;p&gt;As noted in ?comment, the pasting will only work properly in 1D Maple input mode. It works handlily for inserting into the commandline interface, or into a Worksheet with 1D Maple input mode in Standard.&lt;/p&gt;
&lt;p&gt;My Linux &lt;b&gt;~/.mapleinit&lt;/b&gt; file now contains,&lt;/p&gt;
&lt;pre&gt;
interface(prompt=&amp;quot; (**) &amp;quot;):
&lt;/pre&gt;
&lt;p&gt;One could also put that inside a conditional using &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=IsWorksheetInterface"&gt;IsWorksheetInterface()&lt;/a&gt;, to get it in commandline but not in Standard.&lt;/p&gt;
&lt;p&gt;Someone pointed out to me that it is also documented in &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Preprocessor&amp;amp;term=include"&gt;?include&lt;/a&gt; in Maple 12, where it also appears to work. (Your mileage may vary.)&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63064</guid>
      <pubDate>Thu, 08 Oct 2009 20:06:50 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Comment Prompt</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63065</link>
      <itunes:summary>&lt;p&gt;Since I use many different versions of Maple all day, I extended the idea of a comment prompt so that I have version information at a glance.&amp;nbsp; I have the following proc in my .mapleinit&lt;/p&gt;
&lt;pre&gt;
setprompt := proc()
    local versionstring;

    if not IsWorksheetInterface()=true then

        versionstring := StringTools:-Split(ssystem(&amp;quot;echo $MAPLE&amp;quot;)[2][1..-2], &amp;quot;/&amp;quot;)[-1];
        if length(versionstring) &amp;gt; 5 and versionstring[2..5] = &amp;quot;aple&amp;quot; then
            versionstring := versionstring[6..-1];
        end if;

        if not kernelopts(opaquemodules) then
            versionstring := cat(versionstring, &amp;quot;O&amp;quot;);
        end if;

        interface(prompt=cat(&amp;quot;(*&amp;quot;,versionstring,&amp;quot;*)&amp;quot;)):
    end if:

end proc;
&lt;/pre&gt;
&lt;p&gt;So that my prompt in Maple 13 looks like (*13*), or (*13O*) if I have modules set to opaque.&amp;nbsp; It does rely on your different versions of maple being installed in directories named ../mapleXX, so it is probably unix specific.&lt;/p&gt;
&lt;p&gt;If one were committed to not using the directory name, you could translate the output of version() into a release number using a lookup table.&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63065</guid>
      <pubDate>Fri, 09 Oct 2009 17:56:13 Z</pubDate>
      <itunes:author>jpmay</itunes:author>
      <author>jpmay</author>
    </item>
    <item>
      <title>getenv</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63066</link>
      <itunes:summary>&lt;p&gt;Rather than ssystem(&amp;quot;echo $some_env_var&amp;quot;)[2]&amp;nbsp; you can use getenv(&amp;quot;some_env_var&amp;quot;).&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63066</guid>
      <pubDate>Sat, 10 Oct 2009 01:31:37 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>=true</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63067</link>
      <itunes:summary>&lt;p&gt;I would drop =true.&lt;/p&gt;
&lt;p&gt;Alec&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63067</guid>
      <pubDate>Sat, 10 Oct 2009 12:08:13 Z</pubDate>
      <itunes:author>alec</itunes:author>
      <author>alec</author>
    </item>
    <item>
      <title> Which is fine unless you</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63068</link>
      <itunes:summary>&lt;p&gt;&amp;nbsp;Which is fine unless you want your .mapleinit file to work in older versions of maple where IsWorksheetInterface() returns unevaluated.&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63068</guid>
      <pubDate>Sat, 10 Oct 2009 17:22:41 Z</pubDate>
      <itunes:author>jpmay</itunes:author>
      <author>jpmay</author>
    </item>
    <item>
      <title>searchtext</title>
      <link>http://www.mapleprimes.com/maplesoftblog/36643-Thread-Safety?ref=Feed:MaplePrimes:Thread Safety:Comments#comment63069</link>
      <itunes:summary>&lt;p&gt;But then it would work differently in older Maple versions. The following seems to be working the same everywhere,&lt;/p&gt;
&lt;pre&gt;if searchtext("worksheet",interface('version'))=0 
&lt;/pre&gt;
&lt;p&gt;Alec&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Blog Entry, Thread Safety</description>
      <guid>63069</guid>
      <pubDate>Sat, 10 Oct 2009 23:26:44 Z</pubDate>
      <itunes:author>alec</itunes:author>
      <author>alec</author>
    </item>
  </channel>
</rss>