<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, evalhf and module export question</title>
    <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question</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 19:03:34 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 19:03:34 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, evalhf and module export question</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, evalhf and module export question</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question</link>
    </image>
    <item>
      <title>Yes it is, but for silly reasons</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment76041</link>
      <itunes:summary>Look at the following:
&lt;pre&gt;&amp;gt; ToInert(p:-sin);

  _Inert_ASSIGNEDLOCALNAME("sin", "PROC", 143973196, _Inert_ATTRIBUTE(

        _Inert_NAME("protected",

        _Inert_ATTRIBUTE(_Inert_NAME("protected")))))

&lt;/pre&gt;
which mostly says that p:-sin looks like a (local) name 'sin'.  And evalhf does its dispatch based &lt;strong&gt;solely&lt;/strong&gt; on the name of the function.

Whether this is right or wrong is another matter, but it is in many ways ``expected''.</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>76041</guid>
      <pubDate>Fri, 10 Aug 2007 17:23:52 Z</pubDate>
      <itunes:author>JacquesC</itunes:author>
      <author>JacquesC</author>
    </item>
    <item>
      <title>oh dear</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment85169</link>
      <itunes:summary>While I thank you for the response, Jacques, I'll say that it sounds more like a description of the mechanism that might be used than a rationale for the behaviour. Which new user wouldn't get caught by this? Which expert would guess the (new to Maple 11) behaviour?

It's quite a fumble.

In Maple 10, it did not work like that. Maple would issue an error saying that p:-sin was unknown to it. Eg, "Error, unable to evaluate function `p:-sin` in evalhf".

If Maple 10 can figure out that p:-sin is unknown to it, then Maple 11 should be able to figure out not to dispatch to the global :-sin wherever the code contains the module member p:-sin.

It's a strange behaviour. Did I miss where it's documented, I wonder? Would it affect all function names mentioned in the help-page  ?evalhf,fcnlist ?

acer</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>85169</guid>
      <pubDate>Fri, 10 Aug 2007 18:31:50 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>All of evalhf,fcnlist yes</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment91769</link>
      <itunes:summary>My description was indeed 'operational' rather than a justification.  It is indeed strange that this started ``working'' in Maple 11, it seems like a regression rather than an improvement!  I cannot really think of a rationale for doing this (other than ``it can be done'').

Hopefully we'll get an official answer on this one.  But, just to be sure, you should probably file this as a bug with support@maplesoft.com.</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>91769</guid>
      <pubDate>Fri, 10 Aug 2007 19:52:00 Z</pubDate>
      <itunes:author>JacquesC</itunes:author>
      <author>JacquesC</author>
    </item>
    <item>
      <title>Silly reasons</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment85167</link>
      <itunes:summary>This confused me, because I thought the problem in the &lt;a href="http://www.mapleprimes.com/forum/invalid-object-in-mesh"&gt;"invalid object in MESH" thread&lt;/a&gt; was that evalhf can't handle RealDomain:-sin, and here evalhf treats p:-sin the same as sin.
The distinction, I think, is that in the plot3d example the sin function gets called inside a "wrapper" function that is sent to evalhf.  Thus:

&lt;pre&gt;
&gt; p := module() option package; export sin;
  sin:=proc(x) x; end proc;
  end module:
with(p): 
q:= proc(x) sin(x) end proc;
sin(1);
&lt;/pre&gt;
1
&lt;pre&gt;
&gt; evalhf(sin(1));
&lt;/pre&gt;
.841470984807896505
&lt;pre&gt;
&gt; evalhf(q(1));
&lt;/pre&gt;
Error, unable to evaluate function `p:-sin` in evalhf</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>85167</guid>
      <pubDate>Sat, 11 Aug 2007 00:03:12 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>Extremely fragile</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment91770</link>
      <itunes:summary>In other words, even if the current very partial handling of module exports is by-design, it is quite fragile.  By all accounts, it seems that the Maple 10 behaviour was definitely preferable.  Hopefully this regression will be fixed in 12.</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>91770</guid>
      <pubDate>Sat, 11 Aug 2007 01:03:07 Z</pubDate>
      <itunes:author>JacquesC</itunes:author>
      <author>JacquesC</author>
    </item>
    <item>
      <title>another detail</title>
      <link>http://www.mapleprimes.com/posts/40988-Evalhf-And-Module-Export-Question?ref=Feed:MaplePrimes:evalhf and module export question:Comments#comment91779</link>
      <itunes:summary>&gt; f := module() export g; g:=proc(x) x; end proc; end module:

&gt; evalhf(f:-g(1.1));
                              1.10000000000000008

&gt; evalhf(proc() f:-g(1.1); end proc());
Error, unable to evaluate function `f:-g` in evalhf

&gt; proc() f:-g(1.1); end proc();
                                      1.1

&gt; g:=proc(x) x; end proc:
&gt; evalhf(proc() g(1.1); end proc());
                              1.10000000000000008



There are two problems. The first was that top-level global sin was used instead of the module export foo:-sin. The second is that, more generally, evalhf can find and use module exports when outside a procedure but not when within procedures.

acer</itunes:summary>
      <description>The latest comments added to the Post, evalhf and module export question</description>
      <guid>91779</guid>
      <pubDate>Fri, 17 Aug 2007 20:03:01 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>