This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
New Kawa "path" functions
- From: Per Bothner <per at bothner dot com>
- To: 'Kawa List' <kawa at sources dot redhat dot com>
- Date: Wed, 10 Jan 2007 19:33:39 -0800
- Subject: New Kawa "path" functions
The latest Kawa (1.8.95 and svn) provide a new abstract "path"
type, with concrete URI and filepath sub-types.
This follows the naming convention for types I'm thinking works
better than angle brackets:
var :: TYPE ;; TYPE specifier and implied coercion
(TYPE args) ;; constructor
(TYPE? x) ;; membership test
This of course follows standard Scheme conventions.
Various existing functions, such as open-input-file,
call-with-output-file, file-exists?, etc have been generalized
to coerce their arguments to a path.
There are lots of functions for extracting components out of paths.
See http://www.gnu.org/software/kawa/Paths.html
In some cases I'm not sure I found the right name for the functions.
Even the type name "path" and "filepath" are none-ideal. For
example the word "resource" might work better than "path". Should
"path-file" be "path-path" - or something else? If you have any
opinions or suggestions, I'd prefer to receive them before 1.9
goes out!
There is also an undocumented resolve-uri function, which perhaps
should be renamed.
There is also undocumented functionality for paths that are resolved
using getResource on the classloader of the statically enclosing module.
This will be the base for a future Kawa localization (translation) API.
It is also useful for finding data files in a jar/war.
Javadoc of the abstract path class:
http://www.gnu.org/software/kawa/api/gnu/text/Path.html
--
--Per Bothner
per@bothner.com http://per.bothner.com/