LinkRead

LinkRead[link]

reads one expression from the specified WSTP connection.

LinkRead[link,h]

wraps h around the expression read before evaluating it.

Details

  • link must be an active LinkObject, as returned by functions like LinkLaunch or Links.
  • LinkRead will wait until it has read a complete expression before returning.
  • You can test whether an expression is ready to be read from a particular link using LinkReadyQ.
  • You can use LinkRead[link,Hold] to get an expression from a link without evaluating it.

Examples

Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

Read the first packet:

Write a packet to enter 10!:

Read a packet representing the output prompt:

Read the actual result from the computation:

Close the link:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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