Fwd: TMQL Issue: Functions and Predicates as first-class topics
Lars Marius Garshol <[email protected]> Thu, 15 Mar 2007 13:14:38 +0100
| Newsgroups | gmane.text.xml.xtm.tmql |
|---|---|
| Message-ID | <[email protected]> |
Sent this to the wrong list by mistake. Begin forwarded message: > From: Lars Marius Garshol <[email protected]> > Date: March 15, 2007 12:47:56 PM GMT+01:00 > To: Discussion of ISO/IEC 13250 Topic Maps <[email protected]> > Subject: Re: [tmql-wg] TMQL Issue: Functions and Predicates as > first-class topics > > > * Lars Heuer >> >> - The TM-ish style adds some syntactic noise to functions / >> predicates > > * Robert Barta >> >> I definitely buy that argument, that a 'dedicated' function syntax is >> more dedicated than a generic TM syntax for functions. That is >> true by >> definition, right? :-) > > This is the central point in the discussion, Robert. It would be > nice if you could take the counter-arguments seriously. > >> The downside of a specialized syntax is that - if we want to see >> these >> things as topics, and the TM paradigm allows to do so anyway - it >> takes ANOTHER, ADDITIONAL step to explain that. That step would >> fall away >> if we would use a CTM syntax. > > Correct. However, so what? How important is this for people, > compared to ease of reading/writing of function/predicate > declarations? And how hard is it to explain, anyway? Let's see if I > can do it: > > Each function becomes a topic of type tmql:function, with an > internal > occurrence tmql:return containing the query expression. The function > name becomes an item identifier for the topic. > > Doesn't look like it's much of a problem to explain. > >> What about allowing this in CTM: >> >> person rho >> shoesize 43 >> >> which is saying >> >> rho isa person >> shoesize: 43 > > I'll leave it to the other Lars to tell us whether that's workable > or not in CTM. > >> In this vein >> >> tmql:def nr_employees >> tmql:return fn:length ( $o <- employer) >> >> or dropping the tmql: prefix >> >> def nr_employees >> return fn:length ( $o <- employer) >> >> would also be a valid topic syntax. > > This looks a lot nicer. What about parameter declaration? What > about multi-line functions? > > --Lars M. -- Lars Marius Garshol Mobile: +47 98 21 55 50 CTO, Ontopia Office: +47 23 23 30 83