LinkRead

LinkRead[link]
reads one expression from the specified WSTP connection.

LinkRead[link,h]
wraps h around the expression read before evaluating it.

DetailsDetails

  • 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.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

In[1]:=
Click for copyable input
Out[1]=

Read the first packet:

In[2]:=
Click for copyable input
Out[2]=

Write a packet to enter 10!:

In[3]:=
Click for copyable input

Read a packet representing the output prompt:

In[4]:=
Click for copyable input
Out[4]=

Read the actual result from the computation:

In[5]:=
Click for copyable input
Out[5]=

Close the link:

In[6]:=
Click for copyable input
Introduced in 1996
(3.0)