Skip to content

display

builtin · libnexusinterp/corefcn/pr-output-proprietary.cc

: display (obj)

Show the contents of the object obj, labeled with its variable name.

Nexus invokes display automatically whenever an object needs to appear on screen, which normally happens for a statement that is not terminated by a semicolon. For example:

myclass (...)

Or:

myobj = myclass (...)

As a rule, a user-defined class should override the disp method to replace the default rendering:

myobj = myclass (...)
  ⇒  myobj =

  <class myclass>

If display itself is overridden instead, the override is responsible for printing the object’s name, which inputname can supply.