MathGroup Archive 2009

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

Search the Archive

Packaged Dynamic Problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104011] Packaged Dynamic Problem
  • From: István <replicatorzed at gmail.com>
  • Date: Thu, 15 Oct 2009 07:18:34 -0400 (EDT)

Dear Group,

I have this interesting problem, where a package interferes with
global variables, and I cannot even find the root of this problem. I
managed to scale down the issue to a toy model, concerning two files,
a working notebook, and a package. You can guess, it wasn't easy.

The working notebook (one cell):

DynamicModule[{x = 0}, {Slider[Dynamic@x, {-1, 1}], Dynamic@x},
Initialization :> Needs@"Test`"]

And the package file (named Test.nb, and also .m, one cell):

BeginPackage["Test`"];
FirstFunction::usage = "";
Verbose::usage =
  If[ValueQ[Verbose::usage], Verbose::usage <> "some text",
   "other text"];
Begin["`Private`"];
End[];
EndPackage[];

On my system (7.0.1, WinXP SP2) the working notebook takes at least
for 25 seconds to evaluate (with a fresh kernel), during which my
whole system freezes, and then drops a "One or more dynamic objects
are taking excessively long to finish..." dialogue. I can hit the
'Continue waiting' button, and the slider+value list immediately
appears, but this shouldn't take 25 seconds. (Of course, in this
model, there is no need to call for the Test` package, but
nevertheless, it seems to be the cause of the problem.)
Also if I re-evaluate the DynamicModule (without restarting the
kernel), it gives me an error message:

x$$::shdw: Symbol x$$ appears in multiple contexts {Test`,Global`};
definitions in context Test` may shadow or be shadowed by other
definitions. >>

Clearly there is no x$$ variable defined in Test`, so I don't
understand this message.

The most peculiar thing is that removing either of the usage messages
(with lhs and rhs) from the package seems to solve the problem, at
least in my case. Thus the issue is not specific on one message. I
have no idea how I should advance from this point.

Can anyone reproduce this issue?
Can anyone comment on it?

Istvan




  • Prev by Date: Re: ChemicalData[], SMILES, EdgeRules
  • Next by Date: Re: generating submultisets with repeated elements
  • Previous by thread: Re: - limited from a pipe?
  • Next by thread: Re: Packaged Dynamic Problem