Has anyone seen something like this in Lisp? I was thinking of something like this for small projects, or projects I only want to play with.
(defvar *included* nil "Temporarily holds all included file paths.
That is, holds all paths to files loaded with the include form.")
(defun include (path)
"This is my simple utility function that you can use to include files
with automatic single-load-per-file functionality."
(let^ (path (pathname path)
firstone (not *included*))
(unless (member path *included* :test #'equalp)
(push path *included*)
(load path))
(when firstone
(setf *included* nil))))
Usage would be to include all of the dependencies of the code in a file at the top, like this:(include "(partial) path to xyz")
(include "(partial) path to abc")
;;; use xyz and abc
I'm interested in thoughts, comments, and if anyone's seen it before...