ob-julia
ob-julia copied to clipboard
Result formatting: Base, Dictionary
What can I say, it's a bit weird at the moment.
#+begin_src julia
Dict([("A", 1), ("B", 2), ("C", 3)])
#+end_src
#+RESULTS:
| B | A => 1 | C => 3) |
|---+--------+---------|
Suggested output formats:
- A :: 1
- B :: 2
- C :: 3
or
| A | 1 |
| B | 2 |
| C | 3 |
Yeah it's weird because it's not implemented :) The main problem with your options is that we should also deal with nested dictionaries. What are other languages doing?
As a side note, the way you construct dictionaries is strange. You are first constructing an array, and then converting it to dict. I guess the correct way is:
Dict("A" => 1, "B" => 2, "C" => 3)
I checked python, and it wasn't doing anything good. For now, I've implemented the following behaviour:
#+begin_src julia
Dict("a" => 1, "b" => 2, "c" => Dict("d" => 3))
#+end_src
#+RESULTS:
| a | 1 |
| b | 2 |
| c | Dict("d" => 3) |
I think this is better than nothing, and we can always improve it.