Noob question: Function to prompt for input

tommy mato <[email protected]> Sat, 13 Mar 2010 08:59:56 -0800 (PST)
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
I want to do something simple like create a function that prompts for input.
In any other language that would be trivial. I have spent 6 hours at this
today and not getting any closer. I've tried so many combinations.

Here is my latest version of the function:

fun getletter _ = (print "Please enter your guess as a character string: ";
val line = valOf (TextIO.inputLine TextIO.stdIn);
String.substring(line, 0, 4));

I get back a meaningless error message:

outer.sml:1.79 Error: syntax error: replacing SEMICOLON with RPAREN

Any ideas? Thanks in advance.
-- 
View this message in context: http://old.nabble.com/Noob-question%3A-Function-to-prompt-for-input-tp27889172p27889172.html
Sent from the SML/NJ mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev