Subscribe

Redefining the Clisp toplevel loop

  1. 2008-01-09 18:18:18 PST
    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.
  2. sdsProject AdminAccepting Donations

    2008-01-10 06:36:45 PST
    most of clisp discussion is happening on the mailing lists.
    clisp-list appears to the the appropriate place for your post.
  3. sdsProject AdminAccepting Donations

    2008-01-10 06:40:04 PST
    it is not clear what you are trying to accomplish, BTW.
    the if init-function calls exit, the clisp REPL is completely bypassed.
  4. 2008-01-13 17:55:55 PST
    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.
  5. 2008-01-14 04:03:48 PST
    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.
  6. sdsProject AdminAccepting Donations

    2008-01-14 07:49:29 PST
    clisp-list is a MAILING LIST, not a WEB FORUM.
    https://lists.sourceforge.net/lists/listinfo/clisp-list
  7. sdsProject AdminAccepting Donations

    2008-01-14 07:52:32 PST
    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.
  8. 2008-01-15 01:20:02 PST
    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)?
  9. sdsProject AdminAccepting Donations

    2008-01-15 19:18:11 PST
    the symbols are internal in SYS package.
    you can catch, but you cannot expect them to stay the same in the next release.
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.