I am trying to redefine the Clisp toplevel loop and I didnt find any information about that (even googling with main-loop).
I did find that function ext:saveinitmem can be used with :init-function reference to some function to be used before the loop begins (and that could do it eventually).
I did find that the global *driver* (I'm in -modern) pointed to system::main-loop, and I could try to redefine its value to my own loop, perhaps it would work.
But then what about the throw tags that read and eval surely throw to the catch (tagbody or block) of the toplevel loop? How can I catch them if I dont even know their names? I could do with a pseudo-definition of main-loop, especially with its catches (or similar constructs) and its global variables.
What I am trying to do is essentially get my own read and print functions working in the REPL in place of Clisp's read and print functions ; I would like to take control of the REPL and of what it catches, especially the break throw tags, in order to handle them myself. Ideally what would answer my problem is a description of the real REPL with all its catches, not just (loop (print (eval (read))))! If I knew the tags thrown, I could replace the REPL with my own and handle everything my way. Well, if I knew how to replace the REPL with my own, that is.
I am an old Lisper (adept of Mulisp some thirty years ago and then tried various dialects), but not very fluent in Common Lisp (nor in English), and am trying to port into Clisp my bad habits and also some good ideas and tools I have for teaching computer science and NLP.
if you want to know how clisp repl works, you have to study the clisp/src/reploop.lisp file.
but you do not need that to write your own.
all you need to do is to write your own repl function and make it the init-function of your image.
yes, there are useful goodies in reploop.lisp, but they are not exported, so you can use them at your own risk.