Hello,

Perhaps this is something to do with my failure to understand unix pipes, but the following confuses me...

I open poly from a shell and I type the following:

fun loopy () =
        let val sopt = TextIO.inputLine(TextIO.stdIn);
        in case sopt of SOME s => (print s; loopy ())
                      | NONE => ()
        end;
PolyML.export ("foo", loopy);
OS.Process.exit OS.Process.success;

then I make this into a nice program call foo with:

cc -o foo foo.o -L${POLYLIB} -lpolymain -lpolyml

(${POLYLIB} is the local location of my poly libs)

That does what I expect it to, it echos.

However, the following misbehaves:

echo 'fun loopy () =
        let val sopt = TextIO.inputLine(TextIO.stdIn);
        in case sopt of SOME s => (print s; loopy ())
                      | NONE => ()
        end;
PolyML.export ("foo", loopy);
OS.Process.exit OS.Process.success;' | poly

Somehow the "OS.Process.exit OS.Process.success;" becomes the first input whenever I foo...

Is this my confusion, or is it really misbehaving?

(PolyML5.2, Ubuntu 8.04)

cheers,
lucas
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply via email to