Hi,

I've noticed that Poly/ML handles console I/O differently than at least SML/NJ 
and Moscow ML.

When you read from stdIO in the interactive system, reading starts immediately 
after the end of the ML compiler input:

  Poly/ML 5.5.0 Release
  > TextIO.inputLine TextIO.stdIn;Hello.
  val it = SOME "Hello.\n": string option

...while in SML/NJ and Moscow ML, reading starts with the next input line:

  Standard ML of New Jersey v110.74 [built: Tue Jan 31 16:23:10 2012]
  - TextIO.inputLine TextIO.stdIn;
  Hello.
  val it = SOME "Hello.\n" : string option

This matters especially if you are writing an interactive program which writes 
prompts to stdOut. Using Poly/ML, the program must do a dummy read to "consume" 
the rest of the compiler input before writing a prompt. This causes an 
incompatibility with SML/NJ and Moscow ML.

Worse, if you run a stand-alone application of the program built using Poly/ML 
there is no compiler input to read, so Poly/ML becomes incompatible with 
itself...

I feel that the reasonable behavior is that of SML/NJ and Moscow ML. Is it 
possible to change this in Poly/ML?

Lars-Henrik

Lars-Henrik Eriksson, PhD, Senior Lecturer
Computing Science, Dept. of Information Technology, Uppsala University, Sweden
E-mail: [email protected], Web: http://www.it.uu.se/katalog/lhe?lang=en
Phone: +46 18 471 10 57, Mobile: +46 705-36 39 16, Fax: +46 18 51 19 25


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

Reply via email to