[sc34wg3] TMCL and MAX_INT

Graham Moore gra at networkedplanet.com
Mon Feb 23 06:22:25 EST 2009


So, the cleanest fix seems:

Have optional params on the templates and in the ctm / tmdm the max is
simply missing, meaning that its unlimited. I believe the TMQL
semantics already works along these lines.

This means we need IF in ctm?

2009/2/23 Lars Marius Garshol <larsga at garshol.priv.no>:
>
> * Graham Moore
>>
>> [(1)] Sounds like lots of work even if we come up with a technical
>> solutions.
>
> Yeah. I don't think this is feasible, really.
>
>> [(2)] This still leaves us in the spec needing to indicate what that
>> value actually is. Also, what does the expansion look like? Doesn't
>> this
>> just push the problem around?
>
> I was thinking that if you leave out the max-card occurrence that
> means the maximum is unlimited. Similarly for min-card. It requires us
> to write the TMQL that way, but that should be no problem.
>
> Actually, this is required for (3) to work as well, since otherwise
> how do we specify tmcl:unlimited?
>
>> [(3)] Would this mean that only these topics were allowed, could I
>> introduce a 1-4 card topic and have it understood?
>
> What I was thinking was that we'd basically just move min-card and max-
> card onto these cardinality topics and not make any other changes.
> People could then use the TMCL-defined cardinality topics or their
> own, and they could even duplicate tmcl:unlimited themselves if they
> want to.
>
>> A variant of this would be to store this value in an occurrence
>> whose data type is string and have the semantics of evaluation cast
>> it to an Int even when the value is *.
>
> I guess this is the same as the StrToInt("*") proposal below?
>
>> [(4)] I dont like this due to what is template bloat and makes it
>> seem like there are lot more things for people to learn.
>
> I agree.
>
>> We introduce in CTM some casting functions, so the template would be
>>
>> ph:photo isa tmcl:topic-type ;
>>   plays-role-unlimited(ph:categorized, ph:in-category, 0,
>> StrToInt("*")) .
>>
>> And we define StrToInt as fundamental functions that have a certain
>> behaviour, including for StrToInt a * to be the max int as defined in
>> the local system. This is similar to one except its a CTM fix not a
>> TMDM one. The bad thing about this is that an actually Int will get
>> stored, not a symbol for infinity.
>
> I guess that's really a version of solution (1) that might actually
> work. That is, instead of using
>
>   MAX_INT
>
> we use
>
>   "StrToInt(\"*\")"
>
> and do the necessary TMQL magic to have that work.
>
> Downsides:
>
>  - this is not actually an integer literal, so datatyping is messed up,
>  - it's not exactly pretty to write, and
>  - it requires a bit of TMQL machinery etc.
>
> --Lars M.
> http://www.garshol.priv.no/blog/
> http://www.garshol.priv.no/tmphoto/
>
>
>
> _______________________________________________
> sc34wg3 mailing list
> sc34wg3 at isotopicmaps.org
> http://www.isotopicmaps.org/mailman/listinfo/sc34wg3
>



-- 
Graham Moore, Director, Networked Planet Limited
Editor XTM 1.0, ISO13250 (TopicMaps) -2,-3, TMCL
e: graham.moore at networkedplanet.com
w: www.networkedplanet.com
t: +44 1865 811131
m: +44 7769658611 (UK)
m: +47 45271713   (Norway)

Networked Planet Limited is registered in England and Wales, no. 5273377


More information about the sc34wg3 mailing list