MathGroup Archive 1994

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: functions in packages

  • To: mathgroup at
  • Subject: Re: functions in packages
  • From: rubin at (Paul A. Rubin)
  • Date: Mon, 20 Jun 94 13:10:47 EDT

>I am new to Mma so please forgive me if this is a FAQ.  I have written a 70
>line function which calcuates a nonparametric skew-corrected standard
>deviation.  The function works perfectly when entered directly into a
>notebook, but I want to include this function in a package of analytical
>spectroscopy/chemometrics functions that I have written.  When the function
>is placed into the package it seems to refuse to calculate some of the
>lines and instead returns them symbolically, which crashes the function in
>later steps. I have directly copied the function from the package into a
>notebook and it works perfectly outside of the package.  I have racked my
>brains trying to figure out what is wrong to no avail.  Do any of you have
>any ideas or similar experiences?  I'd appreciate any help.
>- Robert G. Buice, Jr.                                -
>- Analytical Spectroscopy Group               \|      -
>- College of Pharmacy                  -------(|      -
>- University of Kentucky                      /|      -
>- internet: super295 at      Laser in Use    -
>- (606) 257-2570                                      -
This sounds like a context problem.  The parts that go uncalculated in the
package version may be referring to a symbol (such as a function) which is
visible to the routine when it is in the notebook (and, more precisely, in
the Global context) but invisible from inside the package.  In particular,
if you refer to functions or variables stored in another context, you need
to make sure that context is on the context path when you build the package.

Sorry I can't be more specific.  If you can't track the problem down, I'd be
willing to look at the actual package and see if I could spot the problem.
(You can e-mail to me at the address below.)

* Paul A. Rubin                                  Phone: (517) 336-3509   *
* Department of Management                       Fax:   (517) 336-1111   *
* Eli Broad Graduate School of Management        Net:   RUBIN at MSU.EDU    *
* Michigan State University                                              *
* East Lansing, MI  48824-1122  (USA)                                    *
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE

  • Prev by Date: Re: nonlinear optimization routines?
  • Next by Date: Listable attribute (was Re: eval differential expressions)
  • Previous by thread: functions in packages
  • Next by thread: help