[sc34wg3] Template parameters in CTM

Lars Marius Garshol larsga at garshol.priv.no
Tue Feb 2 03:36:30 EST 2010


* Robert Cerny
> 
> As far as i understand your email and issue 1908, there seem to be two issues here:
> 
> A. Allowing all kind of topic references to be passed to templates, including references to topics via their subject locators. This would relieve the topic map author of making the subject locator assignment explicit.

No, this is not the issue. There's agreement that all kinds of topic references should be allowed as parameters to templates. 

> B. Allowing arguments to have multiple types. has-psi in your example seems to accept strings and topic references.

This is close to what we are discussing, but not quite it. Consider the following:

 template(= http://example.org )

What am I passing here? Basically, issue 1908 is about whether you should be able to tell simply from looking at that snippet that I'm passing a topic (referenced by its subject locator). 

We might decide to settle the issue so that this is the only possible way you can interpret the template invocation. However, the alternative is to say that in the example I *could* also be passing a simply subject locator (or subject locator assignment, if you prefer), so that the template could be defined this way:

def template($a)
 topic $a .
end

which would cause the subject locator passed to be assigned to the topic "topic". Alternatively, we could say that this is an error, because $a inside the template is bound to a topic, and the fact that it was a subject locator reference is forgotten by the time we get to actually expanding the template contents.

I hope this was clearer. It's a fairly obscure issue. :)

--Lars M.
http://www.garshol.priv.no/tmphoto/
http://www.garshol.priv.no/blog/



More information about the sc34wg3 mailing list