saving things

Started by tom, August 09, 2009, 06:12:12 AM

Previous topic - Next topic

tom

Hey guys,



I have a list I want to either empty or add to depending on whether a checkbox is checked.  How do I save so that the list state survives running  the script?  I can



(save "list.lsp" 'list)



but list.lsp gets rewritten every time I access the page. (I'm mangling newlisp wiki for a specific task)



how do I do that?  Thanks!

cormullion

#1
It seems to work the way you'd expect. Load the list, change it, then save it.


(set 'L '(1 2 3 4))
(save "save.lsp" 'L)

(dotimes (x 5)
    (load "save.lsp")
    (push x L -1)
    (save "save.lsp" 'L))
   
(println L)


and L is (1 2 3 4 0 1 2 3 4)