[top][index]
search for:

String << Thing -- print to a file

Synopsis:

  • Operator: <<
  • Input:
  • an instance of class String.
  • an instance of class Thing.
  • Output:
  • an instance of class File.
  • "name" << x -- prints the expression x on the output file named "name".

    Returns the newly created File associated to the given name. Parsing associates leftward, so that several expressions may be displayed with something like "name"<<x<<y<<z. It will often be convenient to let the last output operation close the file, as illustrated below.

    i1 : "foo" << 2^30 << endl << close

    o1 = foo

    o1 : File
    i2 : get "foo"

    o2 = 1073741824

    Code:

         -- ../../../Macaulay2/m2/files.m2:4
         String << Thing := File => (filename,x) -> openOut filename << x

    [top][index]
    search for: