This is the mail archive of the kawa@sources.redhat.com 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]

Re: Suggestions for handling XML from Kawa?


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/


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