Fwd: [tmql-wg] TMQL Issue: Functions and Predicates as first-class
Lars Marius Garshol
larsga at ontopia.net
Thu Mar 15 08:14:38 EDT 2007
Sent this to the wrong list by mistake.
Begin forwarded message:
> From: Lars Marius Garshol <larsga at garshol.priv.no>
> Date: March 15, 2007 12:47:56 PM GMT+01:00
> To: Discussion of ISO/IEC 13250 Topic Maps <sc34wg3 at isotopicmaps.org>
> 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 /
> * 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
>> 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
> 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
More information about the tmql-wg