3

Consider the following:

m=Quantity[1,"meter"]

If I run the package, it will return 1m

But when I load the package, the package is re-evaluated meaning, that internet i required.

Is it possible to use cached results in a Mathematica package?

OskarNS
  • 33
  • 2

1 Answers1

3

For this specific case (units in Quantity) a solution is relatively simple: if you use the "standard" unit name Mathematica won't need to use the internet to try to interpret ist. Here that means using "Meters" should avoid the slow evaluation in the first place (I think that is documented and was already discussed once on this site)>

m = Quantity[1,"Meters"]

if in doubt you can get the "standard" unit notation with something like this:

Quantity[1,"meter"]//InputForm
Albert Retey
  • 23,585
  • 60
  • 104