In prolog, or at least in SWI-Prolog, you can load a file typing
[filename].
or
['filename.ext'].
or
[path/to/file].
or
['path/to/file.ext'].
However, I want to preprocess the file going to be loaded and therefore I need the content of above singleton lists to be a compatible file path, using it as first argument of open/3
. What currently works:
- The hook to catch queries from REPL using
expand_query/4
- Matching for singleton list expressions and binding the one element to a variable
What works not:
- Using the in »2.« mentioned variable as
+SrcDest
foropen/3
.
So how can I process the quasi-path to a real path, such that any of the 4 above mentioned ways to load a module works?