next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: NetFile

NetFile -- the class of all net files

Description

This class is experimental. Net files are intended to supplant output files eventually. Whereas a file is a stream of bytes, or in some non-unix operating systems, a sequence of lines each of which is a sequence of bytes, a net file is a sequence of lines, each of which is a net. Each output line is assembled by joining nets one by one.
i1 : f = newNetFile()

o1 = <<a netfile>>

o1 : NetFile
i2 : f << "aabbcc" << endl

o2 = <<a netfile>>

o2 : NetFile
i3 : f << "aa" << "bb"^1 << "cc"^-1 << endl

o3 = <<a netfile>>

o3 : NetFile
i4 : f << "aa" << "bb"^1 << "cc"^-1 << endl

o4 = <<a netfile>>

o4 : NetFile
i5 : getNetFile f

                bb      bb
o5 = (aabbcc, aa    , aa    )
                  cc      cc

o5 : Sequence
i6 : peek oo

                +------+  +------+
      +------+  |  bb  |  |  bb  |
o6 = (|aabbcc|, |aa    |, |aa    |)
      +------+  |    cc|  |    cc|
                +------+  +------+
i7 : class \ ooo

o7 = (Net, Net, Net)

o7 : Sequence

Methods that use an object of class NetFile :

For the programmer

The object NetFile is a type, with ancestor class Thing.