[top][index]
search for:

input -- read Macaulay 2 commands and echo

input "f" -- reads and executes the commands found in the file named f, echoing the input, printing the values, and incrementing the line number.

The file is sought in the directory containing the file currently being loaded, if any, and then along the path, unless the name of the file begins with the character(s) in pathSeparator.

If one of the expressions in the file evaluates to the symbol end the reading of the file is stopped at that point.

If an error occurs while evaluating the expressions in the file, reading is stopped.

See also:

  • path -- list of directories to look in
  • needs -- read Macaulay 2 commands if necessary
  • load -- read Macaulay 2 commands
  • Code:

         -- ../../../Macaulay2/m2/setup.m2:207-212
         input = (filename) -> (
              oldnotify := notify;
              notify = false;
              if not tryload(filename,oldinput) then error ("can't open file ", filename);
              notify = oldnotify;
              )

    [top][index]
    search for: