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

printing issue #154

Open
cedricvanrompay opened this issue Mar 9, 2015 · 11 comments
Open

printing issue #154

cedricvanrompay opened this issue Mar 9, 2015 · 11 comments

Comments

@cedricvanrompay
Copy link

I think there is a problem with printing.
Here is what I got:

# print_int 3;;
- : unit = <unknown constructor>
# print_string "Hello";;
- : unit = <unknown constructor>
# print_string "x = ";;
- : unit = <unknown constructor>
# ;
File "", line 1, characters 21-22:
Error: Syntax error
# print_string "x = "; print_int !x; print_newline ();;
- : unit = ()
# Printf.printf "x = %d. Bye %s\n" !x "John";;
- : unit = ()
# Printf.printf "Bye %s\n" "John";;
- : unit = ()
@sfcgeorge
Copy link

Yep I get that too. And a lot of the tutorial involves printing so it's kinda useless when all you see is - : unit = ().

@Daniel-Hug
Copy link

I found out you have to open the browser's console to see the printed values. In chrome that's f12 (open devtools), then ESC (open console drawer). This is not obvious at all from the tutorial though. :(

@pthedinger
Copy link

It's probably worth noting that in Chrome I'm seeing that
print_int 3
doesn't come out to the console straight away either - it is buffered. So you have to wait until there is a newline to be able to see it. Just having the console open won't be enough

@markbao
Copy link

markbao commented Feb 29, 2016

+1, still not fixed as of today

@hhugo
Copy link

hhugo commented Feb 29, 2016

#146

@markbao
Copy link

markbao commented Feb 29, 2016

@hhugo Nice, thanks. Does that mean that someone just needs to make a PR to update the js-of-ocaml dependency? I would help but I'm not very familiar with this.

@hhugo
Copy link

hhugo commented Mar 2, 2016

I never managed to build tryocaml myself #135.
The compilation process was non standard and rely on compiler patches (https://github.com/OCamlPro/tryocaml/tree/master/toplevellib) with no support for latest version of ocaml.
The situation may have change, but I don't see anything recent in the commit history.
Also, the website is using a 2 years old version of js_of_ocaml.

An up to date ocaml toplevel is available here :
http://ocsigen.org/js_of_ocaml/dev/files/toplevel/index.html

@cagdasbozman
Copy link
Contributor

We actually are working on a new interface which will be online soon.

@luiscruz
Copy link

luiscruz commented Mar 9, 2016

+1

@zzz6519003
Copy link

@Daniel-Hug thx!

@ericjmorey
Copy link

Problem persists:
#146 (comment)

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

10 participants