On 02/04/2013 11:45, Makarius wrote:
On Fri, 29 Mar 2013, Rob Arthan wrote:
On 29 Mar 2013, at 11:50, David Matthews David.Matthews@prolingua.co.uk wrote: Quite a common thing to do in UN*X applications is not to prompt if the input isn't a terminal. Obviously, I can write my own read-eval-print loop that does that (indeed the read-eval-print loop in my earlier post on this topic doesn't prompt at all), but it might be a nice companion to the change you have just made to make the top level do that out of the box. That would give Gergely Buday exactly what he is asking for (i.e., the ability to have poly read code from the standard input and only output what the compiled code outputs).
Note that for a full stand-alone solution, Gergely also needs to take care of the shebang line in the ML "script".
This is a bit of problem. At least in the languages I know that are used for scripting the # symbol at the beginning of a line begins a comment. That's not true for ML. I guess it would be possible to add an option to simply discard the first line of input.
Anyway, looking at the bigger picture, the general question is how much conventional Unixoid behaviour Poly/ML should provide by default. Using it as script interpreter is one thing. Doing cc-like compilation of object modules and executables is another.
Well, that was the intention behind the changes I made with version 5.0. 5.0 originally only had PolyML.export as the way of exporting the state. PolyML.SaveState was added later.
People have occasionally pointed out to me that the bias of Poly/ML to the good old image dumping looks very alien to the man on the street. Systems like OCaml imitate the compile/link phase of cc more faithfully, which gives many people a better feeling. (I am personally not very excited about how OCaml compilation works.)
One could do a little bit here by including certain polyml options or shell scripts by default, to address both the scripting and the batch-compilation problem in a way that looks familiar to the masses.
Do you has something else in mind apart from PolyML.export? Perhaps some form of separate compilation of modules? I'm not familiar with OCaml.
David