[sc34wg3] TMCL / CTM issue: ctm-integer

Lars Heuer heuer at semagia.com
Wed Dec 23 08:37:01 EST 2009


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>



More information about the sc34wg3 mailing list