Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Redefining the Clisp toplevel loop

Help
gilles
2008-01-10
2013-05-29
  • gilles
    gilles
    2008-01-10

    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.

    Thanks.

     
    • Sam Steingold
      Sam Steingold
      2008-01-10

      most of clisp discussion is happening on the mailing lists.
      clisp-list appears to the the appropriate place for your post.

       
    • Sam Steingold
      Sam Steingold
      2008-01-10

      it is not clear what you are trying to accomplish, BTW.
      the if init-function calls exit, the clisp REPL is completely bypassed.

       
      • gilles
        gilles
        2008-01-14

        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.

         
        • gilles
          gilles
          2008-01-14

          BTW, I thought I posted this post in clisp-list, but it still is in Help Forum ; I have probably missed something, but I cant post anything in clisp-list.

           
          • Sam Steingold
            Sam Steingold
            2008-01-14

            clisp-list is a MAILING LIST, not a WEB FORUM.
            https://lists.sourceforge.net/lists/listinfo/clisp-list

             
            • gilles
              gilles
              2008-01-15

              Thanks for your quick answer. I am not sure about the meaning of not exported goodies: do you mean that I cant catch the throw tags of the built-in functions (read for instance)?

               
              • Sam Steingold
                Sam Steingold
                2008-01-16

                the symbols are internal in SYS package.
                you can catch, but you cannot expect them to stay the same in the next release.

                 
        • Sam Steingold
          Sam Steingold
          2008-01-14

          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.