<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Mission: Impossible</title>
    <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 09:29:51 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 09:29:51 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Mission: Impossible</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Mission: Impossible</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible</link>
    </image>
    <item>
      <title>what is meant by "prints itself"?</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#answer102102</link>
      <itunes:summary>&lt;p&gt;What precisely do you mean by "prints itself"? Do you mean that calling it will produce as output the same result as would evaluating (or printing) it?&lt;/p&gt;
&lt;p&gt;I have set &lt;strong&gt;interface(prettyprint=1)&lt;/strong&gt; for these examples below.&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() print(eval(procname)); end proc;
                 f := proc() print(eval(procname)) end proc;

&amp;gt; f();
proc() print(eval(procname)) end proc;
&lt;/pre&gt;
&lt;p&gt;Note that the above does not work when the procedure is anonymous. But for that case, one can use the new (as of Maple 14, see &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple14/programming"&gt;here&lt;/a&gt;) `thisproc`,&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() print(eval(procname)); end proc:

&amp;gt; %(); # NULL output, ie. it didn't succeed

&amp;gt; proc() print(eval(thisproc)); end proc;
proc() print(eval(thisproc)) end proc;

&amp;gt; %();
proc() print(eval(thisproc)) end proc;
&lt;/pre&gt;
&lt;p&gt;It occurs to me that perhaps you instead mean that you want the result of calling `f` to simply be the name of f.&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc(x)
&amp;gt;    debugopts('callstack')[2];
&amp;gt; end proc:

&amp;gt; f();
                               f

&amp;gt; g:=proc() f(); end proc:
&amp;gt; g();
                               f
&lt;/pre&gt;
&lt;p&gt;I found that callstack &lt;a href="http://www.mapleprimes.com/posts/36290-Call-Stack"&gt;useful&lt;/a&gt; when coding a redefined version of (the protected) `userinfo` which would display results to a Text Component. This worked even when the code was run in a Maplet or other "hidden" facility, and it worked without having (access) to change or edit the original routine sources. The task was harder still -- to find out how the current &lt;em&gt;parent&lt;/em&gt; procedure had been called. I'd meant to blog it...&lt;/p&gt;
&lt;p&gt;Another way to get this simpler effect of printing only the current procedure's own name might be,&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() op(1,''procname''); end proc:

&amp;gt; f();
                               f
&lt;/pre&gt;
&lt;p&gt;Do either of those two interpretations of "prints itself" come close to your intended meaning?&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;What precisely do you mean by "prints itself"? Do you mean that calling it will produce as output the same result as would evaluating (or printing) it?&lt;/p&gt;
&lt;p&gt;I have set &lt;strong&gt;interface(prettyprint=1)&lt;/strong&gt; for these examples below.&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() print(eval(procname)); end proc;
                 f := proc() print(eval(procname)) end proc;

&amp;gt; f();
proc() print(eval(procname)) end proc;
&lt;/pre&gt;
&lt;p&gt;Note that the above does not work when the procedure is anonymous. But for that case, one can use the new (as of Maple 14, see &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple14/programming"&gt;here&lt;/a&gt;) `thisproc`,&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() print(eval(procname)); end proc:

&amp;gt; %(); # NULL output, ie. it didn't succeed

&amp;gt; proc() print(eval(thisproc)); end proc;
proc() print(eval(thisproc)) end proc;

&amp;gt; %();
proc() print(eval(thisproc)) end proc;
&lt;/pre&gt;
&lt;p&gt;It occurs to me that perhaps you instead mean that you want the result of calling `f` to simply be the name of f.&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc(x)
&amp;gt;    debugopts('callstack')[2];
&amp;gt; end proc:

&amp;gt; f();
                               f

&amp;gt; g:=proc() f(); end proc:
&amp;gt; g();
                               f
&lt;/pre&gt;
&lt;p&gt;I found that callstack &lt;a href="http://www.mapleprimes.com/posts/36290-Call-Stack"&gt;useful&lt;/a&gt; when coding a redefined version of (the protected) `userinfo` which would display results to a Text Component. This worked even when the code was run in a Maplet or other "hidden" facility, and it worked without having (access) to change or edit the original routine sources. The task was harder still -- to find out how the current &lt;em&gt;parent&lt;/em&gt; procedure had been called. I'd meant to blog it...&lt;/p&gt;
&lt;p&gt;Another way to get this simpler effect of printing only the current procedure's own name might be,&lt;/p&gt;
&lt;pre&gt;&amp;gt; f:=proc() op(1,''procname''); end proc:

&amp;gt; f();
                               f
&lt;/pre&gt;
&lt;p&gt;Do either of those two interpretations of "prints itself" come close to your intended meaning?&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>102102</guid>
      <pubDate>Tue, 01 Mar 2011 09:24:16 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Explanation</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#comment102103</link>
      <itunes:summary>&lt;p&gt;I have in mind the following: the output of&lt;/p&gt;
&lt;p&gt;Code;&lt;/p&gt;
&lt;p&gt;is&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Code;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I have in mind the following: the output of&lt;/p&gt;
&lt;p&gt;Code;&lt;/p&gt;
&lt;p&gt;is&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Code;&lt;/p&gt;</description>
      <guid>102103</guid>
      <pubDate>Tue, 01 Mar 2011 10:13:38 Z</pubDate>
      <itunes:author>hirnyk</itunes:author>
      <author>hirnyk</author>
    </item>
    <item>
      <title>which language</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#comment102104</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102103"&gt;@hirnyk&lt;/a&gt; Which language did you have in mind, 1D or 2D?&lt;/p&gt;
&lt;p&gt;In the 2D Math, where a trailing semicolon is not required, here are two examples (rendered here as plaintext, but can be keyed in as seen here),&lt;/p&gt;
&lt;pre&gt;proc() Typesetting:-Typeset(thisproc()) end proc()

proc() 'thisproc'() end proc()
&lt;/pre&gt;
&lt;p&gt;And for 1D Maple Notation (keeping &lt;strong&gt;interface(prettyprint)&lt;/strong&gt; at its default value of 3, and operating in a Worksheet in the Standard GUI),&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc () printf("%a;\n",('thisproc')()) end proc();
proc () printf("%a;\n",('thisproc')()) end proc();
&lt;/pre&gt;
&lt;p&gt;At &lt;strong&gt;interface(prettyprint=1)&lt;/strong&gt; in a Worksheet, or in the commandline interface, one of the earlier 1D notation examples works,&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc() print(eval(thisproc)); end proc;
proc() print(eval(thisproc)); end proc;
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102103"&gt;@hirnyk&lt;/a&gt; Which language did you have in mind, 1D or 2D?&lt;/p&gt;
&lt;p&gt;In the 2D Math, where a trailing semicolon is not required, here are two examples (rendered here as plaintext, but can be keyed in as seen here),&lt;/p&gt;
&lt;pre&gt;proc() Typesetting:-Typeset(thisproc()) end proc()

proc() 'thisproc'() end proc()
&lt;/pre&gt;
&lt;p&gt;And for 1D Maple Notation (keeping &lt;strong&gt;interface(prettyprint)&lt;/strong&gt; at its default value of 3, and operating in a Worksheet in the Standard GUI),&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc () printf("%a;\n",('thisproc')()) end proc();
proc () printf("%a;\n",('thisproc')()) end proc();
&lt;/pre&gt;
&lt;p&gt;At &lt;strong&gt;interface(prettyprint=1)&lt;/strong&gt; in a Worksheet, or in the commandline interface, one of the earlier 1D notation examples works,&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc() print(eval(thisproc)); end proc;
proc() print(eval(thisproc)); end proc;
&lt;/pre&gt;</description>
      <guid>102104</guid>
      <pubDate>Tue, 01 Mar 2011 10:53:29 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Older versions</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#comment102106</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102104"&gt;@acer&lt;/a&gt; Thanks for your attention to my question. The answer is sure unexpected for me. Is it possible in the older versions of Maple? I use Maple 13 and your code doesn't work there.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102104"&gt;@acer&lt;/a&gt; Thanks for your attention to my question. The answer is sure unexpected for me. Is it possible in the older versions of Maple? I use Maple 13 and your code doesn't work there.&lt;/p&gt;</description>
      <guid>102106</guid>
      <pubDate>Tue, 01 Mar 2011 11:55:24 Z</pubDate>
      <itunes:author>hirnyk</itunes:author>
      <author>hirnyk</author>
    </item>
    <item>
      <title>Maple 13</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#comment102110</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102106"&gt;@hirnyk&lt;/a&gt; This seems to work in 1D notation in Maple 13.02, 12.02, or 11.02 using the default &lt;strong&gt;interface(prettyprint)&lt;/strong&gt; level of 3 in a Standard Worksheet,&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();
proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();
&lt;/pre&gt;
&lt;p&gt;I wonder if these are suitable for inclusion &lt;a href="http://www.nyx.net/~gthompso/quine.htm"&gt;here&lt;/a&gt;? By coincidence, a work colleague recently wrote a paradox using the term &lt;em&gt;quine&lt;/em&gt; on my whiteboard, when I was expressing my liking of some works of the late philosopher &lt;a href="http://en.wikipedia.org/wiki/Willard_Van_Orman_Quine"&gt;W.V.Quine&lt;/a&gt;.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102106"&gt;@hirnyk&lt;/a&gt; This seems to work in 1D notation in Maple 13.02, 12.02, or 11.02 using the default &lt;strong&gt;interface(prettyprint)&lt;/strong&gt; level of 3 in a Standard Worksheet,&lt;/p&gt;
&lt;pre&gt;&amp;gt; proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();
proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();
&lt;/pre&gt;
&lt;p&gt;I wonder if these are suitable for inclusion &lt;a href="http://www.nyx.net/~gthompso/quine.htm"&gt;here&lt;/a&gt;? By coincidence, a work colleague recently wrote a paradox using the term &lt;em&gt;quine&lt;/em&gt; on my whiteboard, when I was expressing my liking of some works of the late philosopher &lt;a href="http://en.wikipedia.org/wiki/Willard_Van_Orman_Quine"&gt;W.V.Quine&lt;/a&gt;.&lt;/p&gt;</description>
      <guid>102110</guid>
      <pubDate>Tue, 01 Mar 2011 12:17:44 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>It works well</title>
      <link>http://www.mapleprimes.com/questions/102101-Mission-Impossible?ref=Feed:MaplePrimes:Mission: Impossible:Comments#comment102123</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102110"&gt;@acer&lt;/a&gt;&amp;nbsp;The code&lt;/p&gt;
&lt;p&gt;&lt;span&gt;interface(prettyprint=1):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;proc() print(eval(thisproc)); end proc;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;works well in Maple 13. I was hurrying in the morning&amp;nbsp;so I&amp;nbsp;didn't pay attention to &lt;span&gt;interface(prettyprint=1): . It is my fault and I am sorry for that. Many thanks for the reference. I haven't known about W. V. Quine. The positive answer to the question means that the Maple language is a language of high level. My question was inspired by this circumstance. Thanks are made one time. Because of this I&amp;nbsp; simply vote up&amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/102101-Mission-Impossible#comment102110"&gt;@acer&lt;/a&gt;&amp;nbsp;The code&lt;/p&gt;
&lt;p&gt;&lt;span&gt;interface(prettyprint=1):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;proc() print(eval(thisproc)); end proc;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;works well in Maple 13. I was hurrying in the morning&amp;nbsp;so I&amp;nbsp;didn't pay attention to &lt;span&gt;interface(prettyprint=1): . It is my fault and I am sorry for that. Many thanks for the reference. I haven't known about W. V. Quine. The positive answer to the question means that the Maple language is a language of high level. My question was inspired by this circumstance. Thanks are made one time. Because of this I&amp;nbsp; simply vote up&amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <guid>102123</guid>
      <pubDate>Tue, 01 Mar 2011 19:09:37 Z</pubDate>
      <itunes:author>hirnyk</itunes:author>
      <author>hirnyk</author>
    </item>
  </channel>
</rss>