Hi,
I would like to use Typed Racket in Org-mode code blocks with ob-racket-mode and produce Org lists and tables. (Untyped) Racket code works out of the box:
#+BEGIN_SRC racket :results table drawer
'((a 1) (b 2))
#+END_SRC
produces this result
#+RESULTS:
:results:
| a | 1 |
| b | 2 |
:end:
Now I switch to Typed Racket in the following way:
#+BEGIN_SRC racket :results table drawer :lang typed/racket
'((a 1) (b 2))
#+END_SRC
and this breaks with the following error message:
/tmp/babel-9vcsBj/org-babel-p3WZz0.rkt:4:0: Type Checker: missing type for identifier;
consider using `require/typed' to import it
identifier: datum->table
from module: (file /home/scolobb/.emacs.d/elisp/emacs-ob-racket/ob-racket-runtime.rkt)
in: (ob-racket-begin-print-table (quote ((a 1) (b 2))))
It turns out indeed that the Racket part of ob-racket
is written in #lang racket/base
, and then something happens which seems to try to run that code in a Typed Racket context. I am currently trying to figure out what happens exactly.
I also tried to introduce a typed submodule in the following way:
#+BEGIN_SRC racket :results table drawer
(module a typed/racket
'((a 1) (b 2)))
#+END_SRC
but this fails with the following message:
/tmp/babel-9vcsBj/org-babel-whnzhW.rkt:6:0: module: allowed only at the top level or in a module top-level
in: (module a typed/racket (quote ((a 1) (b 2))))
location...:
/tmp/babel-9vcsBj/org-babel-whnzhW.rkt:6:0
At this point, I would gladly take any pointers, hints, or ideas as to how to best proceed. I have been using Org Babel for ages, but I have never really opened the hood before now.