ed in %load-path, and applying each of the file
name extensions listed in %load-extensions."
  (start-stack 'load-stack
               (primitive-load-path name)))

(define-syntax-rule (add-to-load-path elt)
  "Add ELT to Guile's load path, at compile-time and at run-time."
  (eval-when (expand load eval)
    (set! %load-path (cons elt (delete elt %load-path)))))

(define %load-verbosely #f)
(define (assert-load-verbosity v) (set! %load-verbosely v))

(define (%load-announce file)
  (if %load-verbosely
      (with-output-to-port (current-warning-port)
        (lambda ()
          (display ";;; ")
          (display "loading ")
          (display file)
          (newline)
          (force-output)))))

(set! %load-hook %load-announce)

