If I'm entering code into the REPL using clisp
, as in the program you get when you do sudo apt-get install clisp
, is there a way to take all the code you've entered so far and save it in a file? I'm a Lisp beginner so I don't know if that's a ridiculous request or not.
I highly recommend that students in IT classes or students with an interest in programming try out the Repl.it IDE so they can better understand their writing and can practice important skills.
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise.
If your repl is a HTMl website, then go to the website (enter the address above your repl's output), hit Ctrl+P and set the print destination to 'Save to Pdf'. You can then select where to save it on your computer.
If you're a Hacker Plan subscriber, head to the workspace and pick the “Generate code” feature from the context menu. Tell it what you want, and it will automatically detects the language of the file you're in and give you back its best attempt at what you requested.
You can start output recording with the function DRIBBLE.
Other than that I would run CLISP from a terminal program which can save input / output.
As the minimum I would usually use Emacs, run a shell via M-x shell and start the Lisp there. That way the I/O goes into an Emacs shell buffer.
There is also SLIME, which sets up quite a bit more functionality inside Emacs to communicate with a 'slave' Common Lisp. A 'listener' (aka REPL) is part of that.
There is probably a better way, but... If you are using a decent terminal program, you should be able to select the text in the terminal and save it to file. This would include your typed input as well as output, so you would have to manually remove the output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With