net

net x -- format x for printing.

This function is the primary function called upon by << to format expressions for printing. The default method provided by the system is to convert x to an Expression with expression and then to convert that to a net.

A new method for formatting expressions of class X may be installed by the user with code of the form net X := x -> .... The function provided by the user should return a net or a string.

A string is formatted by wrapping it in quotation marks and converting nonprinting characters to escape sequences. A net is formatted for printing by enclosing it in a box.

i1 : "a string"

o1 = a string

o1 : String
i2 : net "a string"

o2 = a string

o2 : String

i3 : ZZ[x];
i4 : x^2

      2
o4 = x

o4 : ZZ[x]
i5 : net x^2

      2
o5 = x

o5 : Net

i6 : code(net,List)

o6 = -- ../../m2/nets.m2:47-50
     net List := x -> horizontalJoin deepSplice (
          "{",
          toSequence between(comma,apply(x,net)),
          "}")

o6 : Net

See also Net, expression, Expression, and Net.


topindexpreviousupnext