I would like to read a term from a (socket) stream (using some user-defined operators) but I don't want to get stuck waiting for the term to be completed (i.e. reaching the "." at the end). E.g., one line should be read from the stream, and if that line doesn't contain a complete term I would like the action to fail (and not pend).
Can I read one line as a list of characters and then convert them to a term? How? The string2term does not seem to do the job.
Just wanted to say that I managed to solve the problem by first writing the string to a temporary file and then reading the term from there (using a catched read/2 call).
If someone can think of a way of doing this without using a temporary file, I'm all ears. Perhaps we need to go into C?
Alexander