[Date Index] [Thread Index] [Author Index]
Re: Difference between two commands.
Budaoy wrote: > What's the difference between these two commands: << and Needs? > Sometimes we use <<Graphics` and sometimes we use > Needs["ComputerArithmetic`"]. Where do they distinguish from each > other? Note that much as far packages are concerned, since, "Needs["context`"] calls Get["context`"]. By convention, the file loaded in this way is the one which contains a package that defines context`." However, "Needs["context`"] loads an appropriate file if the specified context is *not* already in $Packages." (From the online help.) Thus, Needs is more I/O efficient since it reads a package from the hard-drive only once. On the other hands, Get will read a file on the hard-drive every time Get is called regardless whether the corresponding package is already in memory. Also, Get can read dump saved as well as encoded files. Regards, -- Jean-Marc