Echo

Echo[expr]

prints expr and returns expr.

Echo[expr,label]

prints expr prepending label and returns expr.

Echo[expr,label,f]

prints f[expr] prepending label and returns expr.

Examples

open allclose all

Basic Examples  (3)

Print the result of an intermediate computation:

Print an intermediate result using a label:

Report a property of an intermediate result:

Scope  (4)

Echo[] can be used as an argument to other functions because Echo returns its first argument:

Mix Echo and Print statements:

Use Echo with any type of expression:

Print a property of a subexpression:

Applications  (1)

Observe the order in which Cases visits parts of an expression at level 1:

At all levels:

Properties & Relations  (6)

Echo returns the expression in its first argument:

Print returns Null:

EchoFunction is an operator form of Echo:

EchoLabel is an operator form of Echo:

EchoTiming can be used to print the timing of intermediate computations without affecting the result:

1.001376`

Echo can also be used to print the timing, but at the cost of doing the computation twice:

Echo prints the evaluated expression:

Use Unevaluated to print the unevaluated expression:

EchoEvaluation prints the expression before and after evaluation:

1+1
2

Echo is disabled inside QuietEcho:

Wolfram Research (2015), Echo, Wolfram Language function, https://reference.wolfram.com/language/ref/Echo.html.

Text

Wolfram Research (2015), Echo, Wolfram Language function, https://reference.wolfram.com/language/ref/Echo.html.

CMS

Wolfram Language. 2015. "Echo." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Echo.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_echo, author="Wolfram Research", title="{Echo}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/Echo.html}", note=[Accessed: 11-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_echo, organization={Wolfram Research}, title={Echo}, year={2015}, url={https://reference.wolfram.com/language/ref/Echo.html}, note=[Accessed: 11-December-2024 ]}