[sc34wg3] TMCL / CTM issue: ctm-integer

Robert Cerny robert at cerny-online.com
Wed Dec 23 09:05:49 EST 2009


Hi Lars,

I think i might have brought this up in the wrong context. My  
proposal was not directed at CTM but more at TMCL, which uses CTM as  
far as i understand mostly for convenience, but is in other aspects  
independent. So i meant that the defaulting should not take place in  
the CTM template "has-occurrence", but in the TMCL interpreter.

Best regards,

Robert

On Dec 23, 2009, at 2:37 PM, Lars Heuer wrote:

> Hi Robert,
>
> [...]
>> Would it be an option to simply handle it the following way and thus
>> eliminate the need for a special datatype:
>
>> 1) No statement about the upper limit defaults to upper limit =
>> INFINITY.
>
> Even if it is possible to state
>
>     topic has-occurrence(tmcl:comment, 0).
>
> instead of
>
>     topic has-occurrence(tmcl:comment, 0, *).
>
>
> you need a representation for infinity, at least internally. And
> ctm-integer is such a representation.
>
> The following *is* possible in CTM:
>
>
>     def has-occurrence($kind, $min, $max)
>        [...]
>     end
>
>
>     def has-occurrence($kind, $min)
>        has-occurrence($kind, $min, *) # Invokes the ternary has-occ
>     end
>
>
>> 2) No statement about the lower limit defaults to lower limit = 0.
>
> CTM provides no way to assign a default value to a parameter, like
>
>     def has-occurrence($kind, $min=0, $max=*)
>       [...]
>     end
>
> so it is difficult to leave out the lower limit. The new draft
> provides just a feature to use the same template name with different
> parameter numbers (see the binary/ternary 'has-occurrence' example
> above).
>
> Best regards,
> Lars
> -- 
> Semagia
> <http://www.semagia.com>
>
> _______________________________________________
> sc34wg3 mailing list
> sc34wg3 at isotopicmaps.org
> http://www.isotopicmaps.org/mailman/listinfo/sc34wg3

Robert Cerny

Software Development
http://www.cerny-online.com
+43 (0) 676 602 47 37






More information about the sc34wg3 mailing list