recovering old .sav files



On 3/12/08, Alberto Marcone <alberto.marcone at dimi.uniud.it> wrote:

>  ;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*-
>  (in-package :maxima)
>  (DSKSETQ $%I1
>           '((MDEFINE) ((|$Ferm|) $N)
>             ((MPLUS) ((MEXPT) 2 ((MEXPT) 2 $N)) 1)))
>  (ADDLABEL '$%I1)
>  (DSKSETQ $%O1
>           '((MDEFINE SIMP) ((|$Ferm|) $N)
>             ((MPLUS) ((MEXPT) 2 ((MEXPT) 2 $N)) 1)))
>  (ADDLABEL '$%O1)
>  (DSKSETQ $%I2 '((|$Ferm|) 1))
>  (ADDLABEL '$%I2)
>  (DSKSETQ $%O2 5)
>  (ADDLABEL '$%O2)
>  (DSKSETQ $%I3 '((|$Ferm|) 2))
>  (ADDLABEL '$%I3)
>  (DSKSETQ $%O3 17)
>  (ADDLABEL '$%O3)
>  (DSKSETQ $%I4 '((|$Ferm|) 3))
>  (ADDLABEL '$%I4)
>  (DSKSETQ $%O4 257)
>  (ADDLABEL '$%O4)
>  (DSKSETQ $%I5 '(($FACTOR) $%))
>  (ADDLABEL '$%I5)
>  (DSKSETQ $%O5 257)
>  (ADDLABEL '$%O5)
>  (DSKSETQ $%I6 '(($FACTOR) 66))
>  (ADDLABEL '$%I6)
>  (DSKSETQ $%O6 '((MTIMES SIMP FACTORED) 2 3 11))
>  (ADDLABEL '$%O6)
>  (DSKSETQ $%I7 '((|$Ferm|) 4))
>  (ADDLABEL '$%I7)
>  (DSKSETQ $%O7 65537)
>  (ADDLABEL '$%O7)
>  (DSKSETQ $%I8 '(($FACTOR) $%))
>  (ADDLABEL '$%I8)
>  (DSKSETQ $%O8 65537)
>  (ADDLABEL '$%O8)
>  (DSKSETQ $%I9 '((|$Ferm|) 5))
>  (ADDLABEL '$%I9)
>  (DSKSETQ $%O9 4294967297)
>  (ADDLABEL '$%O9)
>  (DSKSETQ $%I10 '(($FACTOR) $%))
>  (ADDLABEL '$%I10)
>  (DSKSETQ $%O10 '((MTIMES SIMP FACTORED) 641 6700417))
>  (ADDLABEL '$%O10)
>  (DSKSETQ $%I11 '((|$Ferm|) 6))
>  (ADDLABEL '$%I11)
>  (DSKSETQ $%O11 18446744073709551617)
>  (ADDLABEL '$%O11)
>  (DSKSETQ $%I12 '(($FACTOR) $%))
>  (ADDLABEL '$%I12)
>  (DSKSETQ $%O12 '((MTIMES SIMP FACTORED) 274177 67280421310721))
>  (ADDLABEL '$%O12)
>  (DSKSETQ $%I13 '((|$Ferm|) 7))
>  (ADDLABEL '$%I13)
>  (DSKSETQ $%O13 340282366920938463463374607431768211457)
>  (ADDLABEL '$%O13)
>  (DSKSETQ $%I14 '(($FACTOR) $%))
>  (ADDLABEL '$%I14)
>  (DSKSETQ $%I15 '(($PRIMEP) 6))
>  (ADDLABEL '$%I15)
>  (DSKSETQ $%O15 NIL)
>  (ADDLABEL '$%O15)
>  (DSKSETQ $%I16 '(($PRIMEP) 7))
>  (ADDLABEL '$%I16)
>  (DSKSETQ $%O16 T)
>  (ADDLABEL '$%O16)
>  (DSKSETQ $%I17 '(($PRIMEP) ((|$Ferm|) 7)))
>  (ADDLABEL '$%I17)
>  (DSKSETQ $%O17 NIL)
>  (ADDLABEL '$%O17)
>  (DSKSETQ $%I18 '(($MAKELIST) (($PRIMEP) ((|$Fermat|) $K)) $K 1 10))
>  (ADDLABEL '$%I18)
>  (DSKSETQ $%I19 '(($MAKELIST) (($PRIMEP) ((|$Ferm|) $K)) $K 1 10))
>  (ADDLABEL '$%I19)
>  (DSKSETQ $%O19 '((MLIST SIMP) T T T T NIL NIL NIL NIL NIL NIL))
>  (ADDLABEL '$%O19)
>  (DSKSETQ $%I20 '(($MAKELIST) (($PRIMEP) ((|$Ferm|) $K)) $K 1 13))
>  (ADDLABEL '$%I20)
>  (DSKSETQ $%O20
>           '((MLIST SIMP) T T T T NIL NIL NIL NIL NIL NIL NIL NIL NIL))
>  (ADDLABEL '$%O20)
>  (DSKSETQ $%I21
>           '(($SAVE)
>             |&C:/Documents and Settings/Alberto
>  Marcone/Documenti/maxima/numeri Fermat.sav|
>             $ALL))
>  (ADDLABEL '$%I21)
>  (MDEFPROP |$Ferm|
>      ((LAMBDA) ((MLIST) $N) ((MPLUS) ((MEXPT) 2 ((MEXPT) 2 $N)) 1))
>      MEXPR)
>  (ADD2LNC '((|$Ferm|) $N) $FUNCTIONS)
>  (MDEFPROP $NSET (NIL $VERSION 1.21) $PROPS)

There are 2 problems here, one is that the save function stores
a lot of stuff which is built-in (and therefore need not be saved),
and the other is that the implementation of strings was changed.
To load this file, either cut off all the stuff beginning here:

>  (ADD2LNC '$NSET $PROPS)

That is slightly risky since the order of items in the file isn't guaranteed.

Or change these symbols to strings:

>  (DEFINE-SYMBOL '&{)
Replace with (DEFINE-SYMBOL "{")

>  (DEFINE-SYMBOL '&})
Replace with (DEFINE-SYMBOL "}")

Sorry for the trouble. File saving and restoring needs some work.
Thanks for bringing this problem to our attention.

Robert Dodier