[sc34wg3] TMCL and MAX_INT

Lars Heuer heuer at semagia.com
Thu Feb 26 12:35:42 EST 2009


[...]
>> I think if we say that cardinalities must be either a non-negative  
>> integer or Inf, that's acceptable. I think I still prefer the  
>> cardinality topics, but I could live with this solution.

> TMCL editors, what about you? Should I add "INF" / "-INF" to the CTM
> specification? This would be added to the natively supported literals
> and becomes either a xsd:double or xsd:float (any preference here?).

I found a problem with INF: Since INF is a valid topic identifier, the
user could use

     INF.

as declaration of a topic. And it would work. Further the user can use
INF as occurrence / variant value:

    my-topic
        occ-type: INF.

and it would work.

But for templates it would not work:

1.
    def tpl($foo)
        $foo.
    end

    tpl(INF)   # Is "INF" a xsd:double or a topic identifier?


2.
    def tpl2($bar)
        topic
           occ-type: $bar.
    end

    tpl2(INF)  # Is "INF" a xsd:double or a topic identifier?


Possible solutions:
1. We could forbid "INF" as topic identifier, INF is always
   interpreted as xsd:double, so INF. would become invalid. Users
   could use "INF" as topic identifier, if they wrap it into an
   explicit item identifier:

       ^<#INF>.

   has the same result as

       INF.

2. We do not use INF at all and switch to cardinality topics

Others?

Best regards,
Lars
-- 
Semagia 
<http://www.semagia.com>



More information about the sc34wg3 mailing list