This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Get (<<)

reads in a file, evaluating each expression in it, and returning the last one.
  • If name is the name of a Mathematica context, ending with a ` context mark character, then Get will process this name to find the file to read.
  • If name is the name of a file, any .m extension must be included explicitly.
  • Get can read .mx files of Mathematica definitions written by DumpSave.
  • Get can read .nb notebook files, returning the Mathematica expressions they represent.
  • <<"name" is equivalent to <<name. The double quotes can be omitted if the name is of the form specified in Operator Input Forms.
  • If a file with name is found to be a directory, Get will look for a file with a name like$SystemID/
  • If the file found by <<name is a directory, Mathematica will try to load the file init.m in that directory.
  • Get by default successively searches for files in the directories specified by the elements of $Path.
  • Get[name, Path->{"dir1", "dir2", ...}] successively searches for files in each of the diri.
  • Syntax errors in Mathematica input files are reported in the standard form: filename: line: syntax error in expr. Get continues attempting to read a file even after a syntax error has been detected. However, if an error is detected, $Context and $ContextPath are reset to the values they had when Get was called.
  • During the execution of Get, the global variable $Input is set to the name of the file being read.
  • Get["file", "key"] reads a file which has been encoded using Encode["source", "file", "key"].
Load a package:
Click for copyable input
This has set up definitions for several symbols in the EquationTrekker` context:
Click for copyable input
Get Mathematica input from a file:
Click for copyable input
The input is evaluated:
Click for copyable input
New in 1 | Last modified in 3