# Caching data in Mathematica package

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?

-
Seen this? You could also Export the information you need to a file and Import it on initialization. –  ssch Nov 12 '13 at 11:56
add comment

## 1 Answer

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

-
Thank you, this solves my problem. –  OskarNS Nov 14 '13 at 8:37
add comment