Question: why DynamicSystems uses GLOBAL user variables?

I found that  DynamicSystems package uses global variable called s

THis makes zero design sense. Why would a package use a global variable that could have been used by a user? 

What is the correct way to prevent this warning message from showing up, as I have no control over what variable can be used in global space.  I also tried to declare as local to the function that is using the package, but that did not help. Only way was to remove variable from global space before.

Any suggestions?  And why DynamicSystems is even using global symbols in first place?


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

z

foo:=proc()
 local sv;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;
 

proc () local sv; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

#warnign goes away when there is no global used  s before the call is made
foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

foo();

x

 


 

Download dynamic_systems_uses_gloabl_s.mw

 

Please Wait...