'save' with write/append flag?

Started by HPW, February 04, 2005, 02:25:32 AM

Previous topic - Next topic

HPW

Would it make sense to add a write/append flag to the save-command?



(save "MyNewFile" "w"  'sym1 'sym2 ....)



(save "MyExistFile" "a"  'sym1 'sym2 ....)



Of cource would break existing code. :-(



Or is it better to do:



(device(open "MyNewFile" "w"))

(print(source 'sym1 'sym2 ....))

(close (device))



(device(open "MyExistFile" "a"))

(print(source 'sym1 'sym2 ....))

(close (device))



(I used my previous wish here for source with multiple arguments, a loop can do it also) ;-)
Hans-Peter

HPW

#1
As mostly the answer is not far away in lisp:



(device(open "MyNewFile" "w"))
(setq mycontent(map source(list 'sym1 'sym2 .... )))
(dolist (symstr mycontent)(print symstr))
(close (device))
Hans-Peter