Ajay
1
Has anyone successfully used Ocaml in org mode ? I am able to evaluate simple code in source code blocks, but unable to use modules.
When I evaluate source code block given below :
#+BEGIN_SRC ocaml
open Some_Module
#+END_SRC
I get :
Error: Unbound module Some_Module
Above code evaluates with no error in normal source code file in spacemacs.
brab
2
Has anyone successfully used Ocaml in org mode ? I am able to evaluate simple code in source code blocks, but unable to use modules.
When I evaluate source code block given below :
#+BEGIN_SRC ocaml
open Some_Module
#+END_SRC
I get :
Error: Unbound module Some_Module
Above code evaluates with no error in normal source code file in spacemacs.
It works fine here.
#+begin_src ocaml
open List
let res = map (fun x → x+1) [1;2]
#+end_src
#+RESULTS:
2 | 3 |
Where is Some_Module defined?
Best,
Alan
Ajay
3
Sorry I did not test any other module and open List does indeed work. Bad assumption.
I wanted to open Owl module, which does not work.
#+BEGIN_SRC ocaml
open Owl
#+END_SRC
brab
4
Ajay
5
Thanks brab. I used #require which became available only after #use “topfind” .
So far code blocks below works.
#+BEGIN_SRC ocaml
#use "topfind" ;;
#require "owl";;
open Owl
#+END_SRC
and
#+BEGIN_SRC ocaml :results output
let m = Mat.uniform 2 2 in
Mat.(print m)
#+END_SRC
1 Like
perry
6
Does all of this imply that Org mode uses the top level to interpret OCaml code and does not run the compiler?
1 Like