;;AUTOLOAD: fatal-error
;;AUTODOC: fatal-error "prints a message and aborts"
;; (fatal-error N format args...)
;;
;;prints the message (print-format *standard-error* format args...)
;;and then exit (terminates the program) with the error code N (default to 1)
;;If N is omitted, default to 1

(defun fatal-error (errorcode &rest args)
  (if (not (typep errorcode Number)) (progn
      (setq args (+ (list errorcode) args))
      (setq errorcode 1)
  ))
  (apply print-format (+ (list *standard-error*) args))
  (write-line "" *standard-error*)
  (flush *standard-error*)
  (exit errorcode)
)

;;AUTOLOAD: die
;;AUTODOC: die "synonym to fatal-error"
;; (die [errorcode] print-format-arguments...)
;;
;;Synonym to fatal-error for perl heads
