Is there an easy way to save all variable values ββin scala REPL?
There is a save command in scala, but it just saves the command history and next time we need to recalculate everything from scratch.
I know that I can manually serialize / de-serialize everything that interests me, but there are two main difficulties (also applicable to java):
- It is difficult to manually write the serialization / de-serialization code for each specific (Serializeable) variable and cannot be decrypted for later use.
- Only Serializable objects can be saved only. I know that saving (sleeping) an arbitrary object can lead to problems (especially for objects working with external resources), but whether or not the problem will depend on the state of the program. Sometimes a programmer is sure that in the current situation there are no problems with saving variables. I think that for a programmer there should be a way to take responsibility for preserving everything, even objects not explicitly defined Serializable.
I appreciate the answers by solving any of these problems.
source share