[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

APPLYing FORMAT



;The following code gives interesting error messages and/or crashes my mac:
;Seems to be on the first case of a multiple argument format string...
;Any ideas?
(defun user-log (string &rest args)
  "Formats the string and args to a User Log file."
(format t "Calling user-log with ~S ~S~%" string args)
  (with-open-file (stream "home;User Log"
                    :direction :output
                    :if-exists :append
                    :if-does-not-exist :create
                  )
(format t "~S~%" stream)
    (apply #'format stream string args)
  )
(format t "Finishing user-log~%")
)

(user-log "~S~%" "Ray")

(user-log "~S~%" 'm-microwave-oven)

(user-log "~S" 7)

(user-log " ~S~%" 'zoom)

(user-log "~S" 7 'zoom)

(user-log "~S ~S~%" 7 'zoom)

(user-log "~S ~S" 7 'zoom)
"TANSTAAFL" Rich lynch@ils.nwu.edu