SML/NJ:获取用户输入
函数运行时如何提示用户输入?
How do I prompt for user input while a function is running?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
函数运行时如何提示用户输入?
How do I prompt for user input while a function is running?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我的代码看起来像这样:
这返回一个
string option
类型的值;通常在文件末尾有一行SOME l
,但NONE
。My code looks something like this:
This returns a value of type
string option
; normally a lineSOME l
, butNONE
on end of file.要从标准输入读取一行,请使用 TextIO.inputLine< /a> 来自标准基础库,我认为你可以做一些类似
澄清的 事情:这会返回一个
string option
类型,如果位于 EOF 则为 NONETo read a line from standard input use TextIO.inputLine from the Standard Basis Library, I think you can just do something like
Clarification: this returns a
string option
type, which is NONE if it is at EOF