Message Boards Message Boards

Send/receive an expression with a complex head via. WSTP.

I can send/receive an expression like a[b,c,d] using WSPutFunction () / WSGetFunction(). How can I send/receive an expression like a[b][c,d]?

This expression has "a[b]" as a Head and "c" and "d" as its arguments.

POSTED BY: YAMADA TAKATOSHI

This was resolved by contacting technical support.

My support person said that I can put an expression a[b][c, d] on a link by

WSPutType(link, WSTKFUNC);
WSPutArgCount(link, 2);
WSPutFunction(link, "a", 1);
WSPutSymbol(link, "b");
WSPutSymbol(link, "c");
WSPutSymbol(link, "d");

The function WSPutType() shows the type of the object to be put on the link. The type can be

WSTKERR,
WSTKINT,
WSTKFUNC,
WSTKREAL,
WSTKSTR,
WSTKSYM

And so on.

More complex cases require further study, but I got a clue.

Thank you, technical support.

POSTED BY: YAMADA TAKATOSHI
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract