Next: libutils file-system paths, Previous: libutils file-system extensions, Up: libutils file-system [Index]
The following bindings are exported by the library (vicare
libraries)
.
Convert the non–empty list of identifiers from a R6RS library name
libname or reference libref into a string representing the
corresponding relative file pathname, without extension but including a
leading #\/
character. Examples:
(library-name->filename-stem '(alpha beta gamma (1 2 3))) ⇒ "/alpha/beta/gamma" (library-name->filename-stem '(alpha beta main (1 2 3))) ⇒ "/alpha/beta/main_" (library-reference->filename-stem '(alpha beta gamma ((>= 3)))) ⇒ "/alpha/beta/gamma" (library-reference->filename-stem '(alpha beta main ((>= 3)))) ⇒ "/alpha/beta/main_"
notice how the component ‘main’, when appearing last, is “quoted” by appending an underscore.
The returned value can be used as:
.sls
.
.fasl
.
Given a string directory pathname and a string library stem: build and return a source or binary library file pathname.
(directory+library-stem->library-source-pathname "a/b/c" "/d/e") ⇒ "a/b/c/d/e.sls" (directory+library-stem->library-binary-pathname "a/b/c" "/d/e") ⇒ "a/b/c/d/e.fasl"
Given a R6RS compliant library name or reference: build and return a
string representing the pathname of a binary library in the current
build directory. The current build directory is the pathname currently
referenced by the parameter compiled-libraries-build-directory
.
(parametrise ((compiled-libraries-build-directory "/a/b")) (library-name->library-binary-pathname-in-build-directory '(c d (1 2 3)))) ⇒ "/a/b/c/d.fasl" (parametrise ((compiled-libraries-build-directory "/a/b")) (library-reference->library-binary-pathname-in-build-directory '(c d ((>= 2))))) ⇒ "/a/b/c/d.fasl"
Given a string representing the file pathname of a source library: strip the file extensions if it is equal to a supported Vicare file extension and return the result. If the file extension is not recognised: return source-pathname itself.
(library-source-pathname->library-stem-pathname "a/b/c.sls") ⇒ "a/b/c" (library-source-pathname->library-stem-pathname "a/b/c.vicare.sls") ⇒ "a/b/c" (library-source-pathname->library-stem-pathname "a/b/c.scm") ⇒ "a/b/c" (library-source-pathname->library-stem-pathname "a/b/c.ss") ⇒ "a/b/c" (library-source-pathname->library-stem-pathname "a/b/c.ciao") ⇒ "a/b/c.ciao"
Given a string representing the file pathname of a source library: strip the file extension if it is equal to a supported Vicare file extension, append the binary library extension and return the result. If the file extension is not recognised: return source-pathname itself with the binary library extension appended.
(library-source-pathname->library-binary-tail-pathname "a/b/c.sls") ⇒ "a/b/c.fasl" (library-source-pathname->library-binary-tail-pathname "a/b/c.vicare.sls") ⇒ "a/b/c.fasl" (library-source-pathname->library-binary-tail-pathname "a/b/c.scm") ⇒ "a/b/c.fasl" (library-source-pathname->library-binary-tail-pathname "a/b/c.ss") ⇒ "a/b/c.fasl" (library-source-pathname->library-binary-tail-pathname "a/b/c.ciao") ⇒ "a/b/c.ciao.fasl"
Next: libutils file-system paths, Previous: libutils file-system extensions, Up: libutils file-system [Index]