I love OCaml, I'm waiting for my copy of Real World OCaml! I am a beginner OCaml programmer, I just know the functional part, a little imperative, but not very much about modules, functors, objects, etc.
For a kind of interpreter project, I did an emacs type evaluation for beginners. I save the triplet list containing the list of bindings of the command name as strings, a description line and the ocaml function to call. The main loop simply looks for a suitable entry in the list and calls the function.
Then it was really easy to add new functional functions, you just write a function and put the entry in the list.
I like the concept of self-expanding like Emacs, it was easily extensible, but not self-expanding.
Can I make the program self-propagating with OCaml? How can I do it?
I know how Emacs works, it's a big virtual machine, so it interprets the code and modifies the runtime itself, but is there any way to add functionality to the OCaml program with modules added by users? or something else?
ps: Do not laugh if my project will sound for you, but I'm a beginner!
thanks
source
share