[PATCH consfigurator 1/3] create package consfigurator.data.util
Sean Whitton
spwhitton at spwhitton.name
Sat Feb 19 22:05:08 GMT 2022
Hello,
On Sat 19 Feb 2022 at 03:43pm -04, David Bremner wrote:
> diff --git a/src/data/util.lisp b/src/data/util.lisp
> new file mode 100644
> index 0000000..2c9c0d1
> +
> +(in-package :consfigurator.data.util)
> +(named-readtables:in-readtable :consfigurator)
> +
> +(defun data-file-path (base-path iden1 iden2 &key type)
> + "Generate a path from BASE-PATH, IDEN1 and IDEN2 by concatentation,
> +optionally adding extension TYPE."
> + (merge-pathnames
> + (uiop:relativize-pathname-directory
> + (uiop:parse-unix-namestring iden2 :type type))
> + (merge-pathnames
> + (uiop:relativize-pathname-directory
> + (ensure-directory-pathname iden1))
> + base-path)))
There is already DATA-PATHNAME in src/data.lisp. Could that be extended
with something like the TYPE argument here, and moved either to your new
utilities library, or just into the regular util.lisp?
It has the advantage of using STRING->FILENAME.
> diff --git a/src/package.lisp b/src/package.lisp index
> 202477f..effac88 100644 --- a/src/package.lisp +++ b/src/package.lisp
> @@ -1018,4 +1021,5 @@
>
> (package :consfigurator.data.local-file)
>
> - (package :consfigurator.data.files-tree))
> + (package :consfigurator.data.files-tree
> + (:local-nicknames (#:util #:consfigurator.data.util))))
I find this nickname a bit confusing because it makes one think of the
existing util.lisp. I think I'd be inclined to import unqualified, but
if you prefer to keep the nickname, how about DATA.UTIL?
--
Sean Whitton
More information about the sgo-software-discuss
mailing list