#32 primitive to restart

closed-rejected
5
2007-09-21
2007-09-06
No

This would specially be useful from an *inferior-lisp* buffer in Emacs (M-x run-lisp)

A primitive, maybe (ext:restart) which re-start the entire Lisp process; on Unix it could just execvp the initial program arguments (as seen by the main() entry point of the Clisp interpreter).

If the idea sounds interesting to someone, I might perhaps be able to submit a patch.

If it already exists, I am interested.

Regards.

Basile Starynkevitch

Discussion

  • Sam Steingold

    Sam Steingold - 2007-09-06
    • status: open --> pending-rejected
     
  • Sam Steingold

    Sam Steingold - 2007-09-06

    Logged In: YES
    user_id=5735
    Originator: NO

    Thank you for your suggestion, but I am not sure this is such a grand idea.

    first, you can implement something like that using ext:argv (http://clisp.cons.org/impnotes/environment-dict.html#argv).

    second, and more importantly, you want to restart the CLISP
    process when something goes seriously wrong,
    and then you probably can't really rely on CLISP doing TRT.
    instead, you should teach Emacs to restart its inferior-lisp process:

    (defun my-il-restart ()
    "Restart the current inferior-lisp."
    (interactive)
    (let* ((buf (get-buffer "*inferior-lisp*)) ; or whatever
    (com (process-command (get-buffer-process buf))))
    (with-current-buffer buf
    (comint-exec buf (buffer-name buf)
    (car com) nil (cdr com)))))

    ps. restart is a name of a CL class
    (http://www.lisp.org/HyperSpec/Body/syscla_restart.html).
    you probably want to name it ext:reexec-lisp-process

    pps. I am marking this "rejected/pending",
    the RFE will be automatically closed in 2 weeks
    unless you get back with an explanation why this is a good idea
    (e.g., "all the other lisps do that and SLIME cannot support CLISP without it").

     
  • Basile STARYNKEVITCH

    Logged In: YES
    user_id=505600
    Originator: YES

    The typical scenario is to restart from scratch and (load "foo.lisp") again. For example, a missing parenthesis makes obviously (load "foo.lisp") fail in the middle of several definitions...

    Such a function (IIRC Scheme48 had something similar) would avoid the user to kill the lisp or slime buffer.

    Regards.

     
  • Basile STARYNKEVITCH

    • status: pending-rejected --> open-rejected
     
  • Basile STARYNKEVITCH

    Logged In: YES
    user_id=505600
    Originator: YES

    Another possible use might be inside a long-standing process, like a FastCGI server. For example it could make sense to restart a CLISP running a FastCGI when the heap is becoming too big.

     
  • Sam Steingold

    Sam Steingold - 2007-09-06
    • status: open-rejected --> pending-rejected
     
  • Sam Steingold

    Sam Steingold - 2007-09-06

    Logged In: YES
    user_id=5735
    Originator: NO

    large heap should be eliminated by GC, check your roots.

    can you name a program that restarts itself?
    (as opposed to its parent restarting it when necessary).

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-rejected --> closed-rejected
     

Log in to post a comment.