Right now I got
Code: Select all
(defun serialize-hmm-model-to-file (file &rest kwords &key &allow-other-keys)
(let ((s (apply #'open (append (list file :direction :output) kwords))))
(serialize-hmm-model s)
(close s)))
-a
Code: Select all
(defun serialize-hmm-model-to-file (file &rest kwords &key &allow-other-keys)
(let ((s (apply #'open (append (list file :direction :output) kwords))))
(serialize-hmm-model s)
(close s)))
I know you now know you can just use with-open-file, but if you did want to do something like the above, you can just (apply #'open file :direction :output kwords) -- no need for that append junk. (You'd probably also want an unwind-protect in there, but that's another issue).sinnatagg wrote:Code: Select all
(defun serialize-hmm-model-to-file (file &rest kwords &key &allow-other-keys) (let ((s (apply #'open (append (list file :direction :output) kwords)))) (serialize-hmm-model s) (close s)))