User input/Text: Difference between revisions

no edit summary
No edit summary
Line 278:
Note: <tt>:: IO Int</tt> is only there to disambiguate what type we wanted from <tt>read</tt>. If <tt>num</tt> were used in a numerical context, its type would have been inferred by the interpreter/compiler.
Note also: Haskell doesn't automatically flush stdout when doing input, so explicit flushes are necessary.
 
=={{header|Io}}==
<lang io>string := File clone standardInput readLine("Enter a string: ")
integer := File clone standardInput readLine("Enter 75000: ") asNumber</lang>
 
=={{header|J}}==
Anonymous user