Problem returning a value from an exported object of a module

March 13 2011 by edvanderplug 3
false
Maple

0


When a procedure is called that is nested inside of a module, it returns its own name rather than the value it calculates.  E.g. here is a very simple package:

somePackage := module ()

  export someproc; 

  someproc := proc (yr)

    return (2010);

  end proc

end module;

 

That compiles fine.  But when this is executed:

somePackage[someproc];

The actual value returned is the string "someproc", not 2010.  How can I make sure that the return statement is properly executed?

 
Loading Comments & Answers

You must be logged into your MaplePrimes account in order to post a comment. If you don't have an account, you can create an account here.

     

Forgot Your Password? Create an Account