Fwd: [tmql-wg] TMQL Issue: Functions and Predicates as
first-class topics
Lars Heuer
heuer at semagia.com
Thu Mar 15 13:12:36 EDT 2007
[...]
>>> 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.
The problem is, that we need a delimiter somewhere because the scope
is not delimited explictely.
Current CTM:
rho isa person
homepage: http://www.... @au office
shoesize: 43
If we want to eliminate the colon, we could write
rho isa person
homepage http://www.... @(au office)
shoesize 43
which I find less readable than the version with the colon. And in
Leipzig the committee decided that CTM with colons is more readable
than a version without. We presentent a version without the colons,
but it was not welcomed.
[...]
>>> 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?
For the template syntax in CTM we use
ctm:tpl identifier
[... template content ...]
end
for templates which have only one paramter. If the template should
take more than one parameter, the user must use brackets.
ctm:tpl identifier($param, $param)
[... template content ...]
end
(The user can also use brackets for just one parameter but she is not
forced to do so).
A bit Ruby-alike.
We use a namespace instead of a keyword but I am open minded to change
that.
Best regards,
Lars
--
http://www.semagia.com
More information about the tmql-wg
mailing list