This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]