This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Suggestions for handling XML from Kawa?
- To: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Subject: Re: Suggestions for handling XML from Kawa?
- From: Per Bothner <per at bothner dot com>
- Date: 18 Aug 2001 17:21:09 -0700
- Cc: kawa at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10108161535040.11934-100000@pop3.ifs.org.uk>
Jocelyn Paine <popx@pop3.ifs.org.uk> writes:
> That would all be very nice. But why stop at matching XML? It would
> be wonderful to have this for manipulating arbitrary Kawa (and
> Java) data structures. One (of several?) problems would be that
> to maintain data abstraction, one would want the patterns to refer
> to public access selectors/methods rather than going down to the
> underlying fields:
>
> (match EXPR
> ((x :: (complex? (get-real -> R get-imag -> I))
> => (something1 R I))
For pattern-based languages like ML you would have that any
constructor like complex can be used as a pattern form:
((x :: (complex (R :: <real>) (I :: <real>)))
=> (something1 R I))
There may be some ambiguity, as you'd want to be able to build up
pattern expressions from variables (to be bound), constructor calls,
predicates, and types specifiers (which can be viewed as the same).
> ((x :: (free-vector? (v :: (get-origin -> O get-end -> E)))
> => (something2 O E))
Perhaps one could do:
> ((x :: (free-vector origin: (O ::) end: (E ::)))
> => (something2 O E))
An interesting link is http://xduce.sourceforge.net/
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/