Message Boards Message Boards

0
|
5301 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Incomplete Package Function Evaluation

Posted 10 years ago
Hello,

I created this package.  It was working it fine when I left it last week.  This week I load it (actually loading packages is very cumbersome in Mathematica but that is another issue) and execute a function and it does not evalute complely.  I have no idea why. 

So the m file is attached and I try to execute zmstrip[0.008,0.015, 0.00274, 4.2] and I get

1.*zmswide[0.008, 0.015, 0.00274]/Sqrt[eeff[0.008, 0.015, 0.00274, 4.2]]

I expect to get a number.  It seems to stop evaluating after it reaches the private functions. 

Anyone have any idea why it is doing this?

Thanks.
Attachments:
POSTED BY: Roger Backhus
2 Replies
Your definition of zmstrip is after the execution of your End[] function.  Hence it is being defined outside of the scope of the `Private context. Since zmstrip depends on zmswide, it does not see zmswide inside of the `Private context and the zmswide that is is trying to call is not defined, so it returns unevaluated.  To solve the problem, move your End[] function  to just before your EndPackage[] function. 

If I do this (see the attached revision) I get:
In[43]:= zmstrip[0.008, 0.015, 0.00274, 4.2]


Out[43]= 48.0763
Attachments:
POSTED BY: David Reiss
Posted 10 years ago
Oh.  I thought public functions were between End and EndPackage and private functions were before End.

Thanks.
POSTED BY: Roger Backhus
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract