Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
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

up vote 2 down vote accepted

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
share|improve this answer
    
Thank you, this solves my problem. –  OskarNS Nov 14 '13 at 8:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.