Shallow

Shallow[expr]

prints as a shallow form of expr.

Shallow[expr,depth]

prints with all parts of expr below the specified depth given in skeleton form.

Shallow[expr,{depth,length}]

also gives parts whose lengths are above the specified limit in skeleton form.

Shallow[expr,{depth,length},form]

uses skeleton form for any parts that match the pattern form.

Details

Examples

open allclose all

Basic Examples  (2)

Shallow display of a list:

Shallow display of a nested list:

Properties & Relations  (3)

Shortened outputs contain Skeleton objects:

Short displays with long expressions shortened from within:

Shallow shortens from the end:

When an input evaluates to Shallow[expr], Shallow does not appear in the output:

Out is assigned the result Range[50], not Short[Range[50]]:

Possible Issues  (2)

The output of Shallow cannot be used as input if k appears in the result:

Copy the output and paste it into an input cell. The 90 will cause an error:

Even when an output omits Shallow from the top level, it is not stripped from subexpressions:

The output does not have Shallow in it:

However, the variable e does have Shallow in it, which may affect subsequent evaluations:

This Join is not evaluated due to the intervening Shallow:

Assign variables first and then apply Shallow to the result to maintain computability:

Wolfram Research (1991), Shallow, Wolfram Language function, https://reference.wolfram.com/language/ref/Shallow.html (updated 1996).

Text

Wolfram Research (1991), Shallow, Wolfram Language function, https://reference.wolfram.com/language/ref/Shallow.html (updated 1996).

CMS

Wolfram Language. 1991. "Shallow." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Shallow.html.

APA

Wolfram Language. (1991). Shallow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Shallow.html

BibTeX

@misc{reference.wolfram_2024_shallow, author="Wolfram Research", title="{Shallow}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Shallow.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_shallow, organization={Wolfram Research}, title={Shallow}, year={1996}, url={https://reference.wolfram.com/language/ref/Shallow.html}, note=[Accessed: 22-November-2024 ]}