Is there a way to keep the state of a REPL Common Lisp or schema?

Is there a way to save REPL state for Common Lisp or schema?

thanks

+6
lisp save scheme common-lisp
source share
3 answers

Most implementations of the circuit are compiled either in C or in some other intermediate format, so I don’t know any of them that preserve the current state of the image. Most of them will compile the binaries, so if you really read the implementation guide.

Generic Lisp, on the other hand, usually exposes this in a certain way. SBCL has the previously mentioned save-lisp -and-die function , and CCL has copy applications . These are the only two Lisp that I use, so if you are using a different implementation, be sure to check the documentation.

If you want to do this, here is one for SBCL. For CCL, check out the Apple Current Converter example . This tutorial ends with examples of actions to remove the resulting application package.

Edit: here is another, simpler example for SBCL.

+2
source share

It depends on the implementation, however you can usually save the image. Please note, however, some things related to external resources may not be available - for example, the state of threads associated with files or the execution status of threads (although there are some versions of the scheme that allow you to save saved continuations). It is not part of the language itself.

+2
source share

Your implementation should support this. For example, SBCL has sb-ext: save- lisp -and-die , with two caveats:

  • The stack unwinds

  • You cannot continue later (obviously).

+2
source share

All Articles