--
You received this message because you are subscribed to the Google Groups "iodide-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iodide-dev+...@googlegroups.com.
To post to this group, send email to iodid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iodide-dev/33e0011d-d41d-475f-8ed8-4fa5b2e9865c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ultimately, you're going to need create a Javascript function that takes a string of OCaml code, runs it, and returns something useful. That's the hard part. Pyodide works by compiling CPython to WebAssembly using emscripten. I don't know if a similar approach would work for OCaml or not There may have been other folks who have "cross-compiled" OCaml before who can give you some pointers.
Le 30 août 2018 à 00:16, Michael Droettboom <mdroe...@mozilla.com> a écrit :Thanks. I'll update the pyodide example. It exists in a couple of places, and I neglected to update it.No, the newlines things is a bonafide bug. I just filed a PR here: https://github.com/iodide-project/iodide/pull/823On Wed, Aug 29, 2018 at 6:00 PM Louis Abraham <abrah...@gmail.com> wrote:Oh thanks... I'll try later when I have a computer :)Not an excuse but I think I used the pyodide notebook as template, you might want to update it.Is the newlines behavior when the evaluator returns a string normal then?
Sent from my mobile. Please excuse the brevity, spelling and ponctuation.
Le mer. 29 août 2018 23:53, Michael Droettboom <mdroe...@mozilla.com> a écrit :Seeing your example now, I think this is due to you using an old version of iodide. Update your tag from
pyodide-20180420
topyodide-20180623
andiodide.output.text
should be available to you.Mike
On Wed, Aug 29, 2018 at 4:40 PM Louis Abraham <abrah...@gmail.com> wrote:You were very clear.I forgot to say I had errors when trying to call `iodide.output.text`.Then I tried to print the objects and it didn't work.Best,Louis
Sent from my mobile. Please excuse the brevity, spelling and ponctuation.
Le 29 août 2018 10:14 PM, "Michael Droettboom" <mdroe...@mozilla.com> a écrit :Sorry, that's my fault for not being clear. `iodide.output.text("String")` should output that string to the output area (rather than to the Javascript console).MikeOn Wed, Aug 29, 2018 at 3:59 PM Louis Abraham <abrah...@gmail.com> wrote:I must admit I am by no means a js expert, let alone when it is called from an OCaml code compiled in js.However, when I call `console.log('iodide')` or `console.log('window.iodide')`, I see an object.But when I call `console.log('iodide.output')`, it displays "undefined".Where is my error?For the moment, I'll just output a string (which is already challenging).IMO, another solution would be to add an output handler (like https://github.com/iodide-project/pyodide/blob/master/src/pyodide.js#L216).Cheers,Louis
To view this discussion on the web visit https://groups.google.com/d/msgid/iodide-dev/a74d7d64-d2f5-4e3c-84bf-54cc7d905969%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to iodide-dev+unsubscribe@googlegroups.com.
To post to this group, send email to iodid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iodide-dev/a74d7d64-d2f5-4e3c-84bf-54cc7d905969%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.