[Date Index] [Thread Index] [Author Index]
Re: Needs and <<
Murray Eisenberg <murray at math.umass.edu> wrote: : << is a special input form for Get. : <<name reads in a file, evaluating each expression in it, and returning : the last one. : Needs["context`", "file"] loads file if the specified context is not : already in $Packages. : But you probably knew that difference. As to reasons The Book uses the : first rather than the second, I can only speculate. Shorter to type, : for one; does no harm (except for some wasted time), for another. In some cases you not only want the package loaded, but you want to be sure that you get the side effects of the evaluation of the expressions in the package. The most obvious case would be something like: <<RealTime3D` where the "alternative": Needs["RealTime3D`"] would only work the first time it was evaluated for a given kernel instance. G.