;;AUTOLOAD: defvar
;;NO AUTODOC: defvar "defines a variable"
;; (defvar variable [initial-value [documentation-string]] )
;; declares and initialize a variable.
;; The advantage over setq is that the variable value is untouched if the
;; variable existed before.
;;
;; (defvar foo 1)                   foo ==> 1
;; (defvar foo 2)                   foo ==> 1

(defmacro defvar (var &optional value doc)
  `(progn
    (if (not (boundp ',var))
      (set (quote ,var) ,value)
    )
    (if (typep ,doc String)
      (documentation (quote ,var) ,doc))
    ,var))
