Re: own package doesnt work correctly?
- To: mathgroup at smc.vnet.net
- Subject: [mg63156] Re: [mg63139] own package doesnt work correctly?
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 16 Dec 2005 07:22:08 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Martin, Symbols like x and I are set up in the package`Private` context once you put the definition inside the package. So they won't match Global`x or Global`I in a notebook using the package. You could either add the Global` context to these symbols in the package, or better yet pass them as parameters to the rule. partintrulx[x_,I_]:= ..... David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Martin [mailto:ms_usenet at gmx.de] To: mathgroup at smc.vnet.net Hello, I started to - try to - use packages written on my own, using the Notebook editor, marking the cells as initialization cells, and saving the NB, producing a .m package at the same time. Using this package did not seem to produce problems, until I wanted to use the following rule for partial integration of a product of functions, to integrate the delta[...] terms: partintrulx = Integrate[δ[Derivative[n_, 0][g_][x, t_]]* Derivative[m_, 0][f_][x, t_], {x, a_, b_}] /; n > 0 :> (D[f[x, t], {x, m}]*δ[D[g[x, t], {x, n - 1}]] /. x -> b) - (D[f[x, t], {x, m}]* δ[D[g[x, t], {x, n - 1}]] /. x -> a) - Integrate[D[f[x, t], {x, m + 1}]* δ[D[g[x, t], {x, n - 1}]], {x, a, b}] Using this definition from the package does not seem to work, if I copy & paste and evaluate it in the Notebook where I want to use it, I can use it without problems. Have I missed something about the definition space of package-defined rules? Thanks for any hint, Martin