Re: Difference between two commands.
- To: mathgroup at smc.vnet.net
- Subject: [mg90502] Re: Difference between two commands.
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Fri, 11 Jul 2008 02:02:50 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <firstname.lastname@example.org>
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