[sc34wg3] Re: [tmql-wg] TMQL Issue: Functions and Predicates as first-class topics

Lars Marius Garshol larsga at garshol.priv.no
Thu Mar 15 07:47:56 EDT 2007


* 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.


More information about the sc34wg3 mailing list