forked from mirrors/org-mode
be8e68be0b
* lisp/ob-ocaml.el (org-babel-execute:ocaml): Support for pretty-printed outputs. E.g. the following snippet produces multiple lines of output, due to pretty-printing #+BEGIN_SRC ocaml :exports code :eval no-export :results verbatim (* Note, no need to have parentheses around sqrt, as application binds the tightest *) let rec gamma n = if n = 0 then (1.0 +. sqrt 5.0) /. 2.0 else 1.0 /. (gamma (n-1) -. 1.0) let nums = List.map gamma (List.init 5 (fun x -> x)) #+END_SRC #+NAME: gamma-tbl #+RESULTS[1fd6a3e846afdef51350eb6d7ba15c6844ccc14e]: : val gamma : int -> float = <fun> : val nums : float list = : [1.6180339887498949; 1.61803398874989468; 1.61803398874989535; : 1.61803398874989357; 1.61803398874989823] (In reality this would have 50 or so outputs, point being mathematically it shouldn't change, but due to floating point errors it does.) The regexp has the following problems: - The "." in group 5 (as-was) doesn't match new-lines, so it only matches the first line, e.g. as a list : - [1.6180339887498949, 1.61803398874989468, 1.61803398874989535, - When using "\\(.\\|\n\\)", it includes the starting indentation of the list, which makes org-babel-script-escape choke (called from org-babel-ocaml-read-list, from org-babel-ocaml-parse-output, from org-babel-execute:ocaml, the code being modified. TINYCHANGE |
||
---|---|---|
.. | ||
Makefile | ||
ob-abc.el | ||
ob-asymptote.el | ||
ob-awk.el | ||
ob-C.el | ||
ob-calc.el | ||
ob-clojure.el | ||
ob-comint.el | ||
ob-coq.el | ||
ob-core.el | ||
ob-css.el | ||
ob-ditaa.el | ||
ob-dot.el | ||
ob-ebnf.el | ||
ob-emacs-lisp.el | ||
ob-eshell.el | ||
ob-eval.el | ||
ob-exp.el | ||
ob-forth.el | ||
ob-fortran.el | ||
ob-gnuplot.el | ||
ob-groovy.el | ||
ob-haskell.el | ||
ob-hledger.el | ||
ob-io.el | ||
ob-J.el | ||
ob-java.el | ||
ob-js.el | ||
ob-latex.el | ||
ob-ledger.el | ||
ob-lilypond.el | ||
ob-lisp.el | ||
ob-lob.el | ||
ob-lua.el | ||
ob-makefile.el | ||
ob-matlab.el | ||
ob-maxima.el | ||
ob-mscgen.el | ||
ob-ocaml.el | ||
ob-octave.el | ||
ob-org.el | ||
ob-perl.el | ||
ob-picolisp.el | ||
ob-plantuml.el | ||
ob-processing.el | ||
ob-python.el | ||
ob-R.el | ||
ob-ref.el | ||
ob-ruby.el | ||
ob-sass.el | ||
ob-scheme.el | ||
ob-screen.el | ||
ob-sed.el | ||
ob-shell.el | ||
ob-shen.el | ||
ob-sql.el | ||
ob-sqlite.el | ||
ob-stan.el | ||
ob-table.el | ||
ob-tangle.el | ||
ob-vala.el | ||
ob.el | ||
ol-bbdb.el | ||
ol-bibtex.el | ||
ol-docview.el | ||
ol-eshell.el | ||
ol-eww.el | ||
ol-gnus.el | ||
ol-info.el | ||
ol-irc.el | ||
ol-mhe.el | ||
ol-rmail.el | ||
ol-w3m.el | ||
ol.el | ||
org-agenda.el | ||
org-archive.el | ||
org-attach-git.el | ||
org-attach.el | ||
org-capture.el | ||
org-clock.el | ||
org-colview.el | ||
org-compat.el | ||
org-crypt.el | ||
org-ctags.el | ||
org-datetree.el | ||
org-duration.el | ||
org-element.el | ||
org-entities.el | ||
org-faces.el | ||
org-feed.el | ||
org-footnote.el | ||
org-goto.el | ||
org-habit.el | ||
org-id.el | ||
org-indent.el | ||
org-inlinetask.el | ||
org-install.el | ||
org-keys.el | ||
org-lint.el | ||
org-list.el | ||
org-macro.el | ||
org-macs.el | ||
org-mobile.el | ||
org-mouse.el | ||
org-num.el | ||
org-pcomplete.el | ||
org-plot.el | ||
org-protocol.el | ||
org-src.el | ||
org-table.el | ||
org-tempo.el | ||
org-timer.el | ||
org.el | ||
ox-ascii.el | ||
ox-beamer.el | ||
ox-html.el | ||
ox-icalendar.el | ||
ox-latex.el | ||
ox-man.el | ||
ox-md.el | ||
ox-odt.el | ||
ox-org.el | ||
ox-publish.el | ||
ox-texinfo.el | ||
ox.el |