On 4/25/20 3:12 PM, Alan Schmitt wrote:
On 2020-04-25 08:43, Malcolm Matalka <mmatalka@gmail.com> writes:

What's the answer??
There is no way to print the code of the function. It is compiled to
bytecode by the toplevel and added to the current environment.


Unless (on Linux/x86-64 at least) you compile the code with the -g debugging option.


Adventurous developers could even couple that with Ian Taylor's libbacktrace library. I leave them to check license compatibility with their lawyers.

https://github.com/ianlancetaylor/libbacktrace

The real issue is of course funding, as usual. DWARF support in Ocaml needs improvement.

https://en.wikipedia.org/wiki/DWARF


--
Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France; <basile@starynkevitch.net>
(mobile phone: cf my web page / voir ma page web...)