InputForm

InputForm[expr]

prints as a version of expr suitable for input to the Wolfram Language.

Details and Options

  • InputForm always produces one-dimensional output, suitable to be typed as lines of Wolfram Language input.
  • InputForm acts as a "wrapper", which affects display, but not evaluation. »
  • Put (>>) produces InputForm by default.
  • Short[InputForm[expr]] can be used, but may generate skeleton objects that cannot be given as Wolfram Language input.
  • The option NumberMarks can be used to specify whether ` marks should be used to indicate type, precision, or accuracy of approximate numbers. »

Examples

open allclose all

Basic Examples  (2)

InputForm of a typeset expression:

InputForm of a graphic:

Scope  (8)

Basic Objects  (2)

Integer, Rational, Real, and Complex numbers:

Arbitraryprecision Real and Complex numbers:

Special constants:

Characters and strings of characters:

Control characters for strings:

Special Input Forms  (4)

Different ways of representing Power expressions:

Special typeset expressions:

Different list structures:

Input without special interpretation:

With special characters in the same positions, there may be special interpretations:

In the case of superscripts, most things get interpreted as Power:

Special Output Forms  (2)

Some objects use a special output representation:

Some objects use an elided output representation:

The elided parts are visible using InputForm:

Options  (3)

NumberMarks  (3)

Machine numbers format without number marks by default:

The same number with number marks:

Extended-precision numbers include number marks by default:

Without number marks:

A mixed symbolic and numeric expression:

Include number marks for all numbers:

Omit all number marks:

Properties & Relations  (3)

InputForm affects display but not evaluation:

Apply InputForm to the evaluated integral:

InputForm has a linear formatting:

FullForm has linear formatting without special syntax:

OutputForm, StandardForm, and TraditionalForm all provide two-dimensional formatting:

Use ToString to generate a string in input form:

Introduced in 1988
 (1.0)
 |
Updated in 1996
 (3.0)