)savesystem is fixed in Axiom by this commit
https://github.com/daly/axiom/commit/abbb38c1a4395448f8d769dff02a4e17c4308bf8
Now )savesystem can preserve variables and functions,
I think it's useful and should be added to FriCAS.
I ported this change to FriCAS as following patch:
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index d3d4fe3..32c7343 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -2138,6 +2138,12 @@ read_or_compile(quiet, lib) ==
type = '"input" => ncINTERPFILE(input_file, not(quiet))
spadCompile(input_file)
+--% )savesystem
+savesystem l ==
+ #l ~= 1 or not(SYMBOLP first l) => helpSpad2Cmd '(savesystem)
+ $ThisIsARunningSystem := true
+ SPAD_-SAVE (SYMBOL_-NAME first l, true)
+
--% )show
show l ==
diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot
index 18f79ca..e7d1b7a 100644
--- a/src/interp/i-toplev.boot
+++ b/src/interp/i-toplev.boot
@@ -87,11 +87,13 @@ interpsysInitialization() ==
interpsys_restart() ==
$IOindex := 1
- $InteractiveFrame := makeInitialModemapFrame()
loadExposureGroupData()
statisticsInitialization()
- initHist()
- initializeInterpreterFrameRing()
+ if not $ThisIsARunningSystem then
+ $InteractiveFrame := makeInitialModemapFrame()
+ initHist()
+ initializeInterpreterFrameRing()
+ $ThisIsARunningSystem := true
if $displayStartMsgs then spadStartUpMsgs()
$currentLine := nil
diff --git a/src/interp/setq.lisp b/src/interp/setq.lisp
index ec75759..b9b2426 100644
--- a/src/interp/setq.lisp
+++ b/src/interp/setq.lisp
@@ -165,6 +165,7 @@
(|pquit| . |interpreter|)
(|quit| . |interpreter|)
(|read| . |interpreter|)
+ (|savesystem| . |interpreter|)
(|set| . |interpreter|)
(|show| . |interpreter|)
(|spool| . |interpreter|)
@@ -209,6 +210,7 @@
|ltrace|
|nopiles|
|read|
+ |savesystem|
|set|
|spool|
|undo|
@@ -462,6 +464,7 @@
'(|$EmptyMode| |$NoValueMode|))
(SETQ |$InitialModemapFrame| '((NIL)))
+(defvar |$ThisIsARunningSystem| nil "Are we restarting a running system?")
(SETQ |$NRTaddForm| NIL)
(SETQ |$NRTdeltaList| NIL)
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.