Next: , Previous: , Up: libutils file-system   [Index]


7.8.2 Library file pathnames

The following bindings are exported by the library (vicare libraries).

Function: library-name->filename-stem libname
Function: library-reference->filename-stem libref

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:

Function: directory+library-stem->library-source-pathname directory stem
Function: directory+library-stem->library-binary-pathname directory stem

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"
Function: library-name->library-binary-pathname-in-build-directory libname
Function: library-reference->library-binary-pathname-in-build-directory libref

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"
Function: library-source-pathname->library-stem-pathname source-pathname

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"
Function: library-source-pathname->library-binary-tail-pathname source-pathname

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: , Previous: , Up: libutils file-system   [Index]