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

Output functions not working #146

Open
let-def opened this issue Aug 4, 2014 · 13 comments
Open

Output functions not working #146

let-def opened this issue Aug 4, 2014 · 13 comments

Comments

@let-def
Copy link

let-def commented Aug 4, 2014

See:

# print_int 4;;
- : unit = <unknown constructor>
# print_string "hello";;
- : unit = <unknown constructor>

Same with Format.fprintf

@hhugo
Copy link

hhugo commented Aug 5, 2014

It outputs on the console

@let-def
Copy link
Author

let-def commented Aug 5, 2014

No it is not (tested on firefox 31 & firefox 29, varisou GNU/Linux).
And printing as <unknown constructor> is incorrect.

Maybe try-ocaml redefine some I/O functions and the API was changed somehow, in any case it is not working.

@hhugo
Copy link

hhugo commented Aug 5, 2014

You need to flush in order to see it.
print_int 4;flush_all()
<unknown constructor> is because some JavaScript primitives return undefined instead of 0. I'm fixing some of those in js_of_ocaml

@let-def
Copy link
Author

let-def commented Aug 5, 2014

Ok. That's confusing for beginners, thanks for fixing that.

@lcdunstan
Copy link

It's confusing, because the tutorial says nothing about the Javascript console

@hhugo
Copy link

hhugo commented Aug 5, 2014

<unknown constructor> issue is fixed in latest js_of_ocaml toplevel http://ocsigen.github.io/js_of_ocaml/

@yadavankur
Copy link

yadavankur commented Apr 24, 2017

Still an issue in Chrome Version 57.0.2987.133 (64-bit). Here is what I see:

# print_int 4;;
- : unit = <unknown constructor>

# print_int 4;flush_all();;
- : unit = ()

@cagdasbozman
Copy link
Contributor

@yadavankur did you check your javascript console ? We are working on a new website, maybe it will be less confusing to use https://try.ocamlpro.com/fun-demo/tryocaml_index.html

@yadavankur
Copy link

Ok, I misunderstood the previous conversation. Yes, the console displays the data. Also, the new website does not have these issues.

@xranom
Copy link

xranom commented Sep 22, 2018

Looks like this is still an issue?

print_int 3;;

  • : unit =

@ericjmorey
Copy link

Using Firefox 68.0 on Lubuntu 18.04 LTS I get the following results: https://pastebin.com/VZD1Sfb8

Problem seems to persist.

@hhugo
Copy link

hhugo commented Nov 14, 2019

What website have you tried ?
https://try.ocamlpro.com has not been updated after the issue was first filled.

Try https://try.ocamlpro.com/fun-demo/tryocaml_index.html instead

@hhugo
Copy link

hhugo commented Sep 30, 2021

@AltGr, I believe this can be closed.

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

7 participants