Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading an integer from standard input in toplevel #25

Closed
romildo opened this issue Oct 18, 2015 · 1 comment
Closed

Reading an integer from standard input in toplevel #25

romildo opened this issue Oct 18, 2015 · 1 comment

Comments

@romildo
Copy link

romildo commented Oct 18, 2015

I cannot read an integer using the read_int function from the Ocaml Toplevel view. Entering the expression read_int () and then entering an integer raises the exception Failure "int_of_string":

# read_int ();;
34;;
Exception: Failure "int_of_string".
# 

So how can an integer be read from the Ocaml Toplevel view?

@nbros
Copy link
Owner

nbros commented Oct 18, 2015

You can use Ctrl+Enter so that the Ocaml Toplevel view won't add ";;" at the end of your input.

@nbros nbros closed this as completed Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants