core/base: Section _yield_ and _rate-each_

master
Mike Gerwitz 2021-06-08 13:26:49 -04:00
parent bf399c0370
commit d4dc1e651b
1 changed files with 59 additions and 52 deletions

View File

@ -217,68 +217,75 @@
</template>
</section>
<template name="_yield_"
desc="Final scalar result provided to caller">
<param name="@values@" desc="Yield calculation" />
<rate yields="___yield" local="true">
<param-copy name="@values@" />
</rate>
</template>
<section title="Calculations">
These templates represent calculations that used to be defined as XSLT
tempaltes before TAME's template system existed.
<template name="_rate-each_"
desc="Convenience template that expands to a lv:rate block summing over
the magic _CMATCH_ set with the product of its value">
<param name="@values@"
desc="Yield calculation" />
<template name="_yield_"
desc="Final scalar result provided to caller">
<param name="@values@" desc="Yield calculation" />
<param name="@generates@" desc="Generator name (optional)">
<text></text>
</param>
<rate yields="___yield" local="true">
<param-copy name="@values@" />
</rate>
</template>
<param name="@yields@" desc="Yield (optional)">
<text>_</text>
<param-value name="@generates@" />
</param>
<!-- at least one of generates or yields is required -->
<if name="@yields@" eq="">
<if name="@generates@" eq="">
<error>must provide at least one of @generates or @yields</error>
<template name="_rate-each_"
desc="Convenience template that expands to a lv:rate block summing over
the magic _CMATCH_ set with the product of its value">
<param name="@values@"
desc="Yield calculation" />
<param name="@generates@" desc="Generator name (optional)">
<text></text>
</param>
<param name="@yields@" desc="Yield (optional)">
<text>_</text>
<param-value name="@generates@" />
</param>
<!-- at least one of generates or yields is required -->
<if name="@yields@" eq="">
<if name="@generates@" eq="">
<error>must provide at least one of @generates or @yields</error>
</if>
</if>
</if>
<param name="@class@"
desc="Space-delimited classifications for predicated iteration" />
<param name="@no@"
desc="Space-delimited classifications for predicated iteration to prevent matches">
<text></text>
</param>
<param name="@class@"
desc="Space-delimited classifications for predicated iteration" />
<param name="@no@"
desc="Space-delimited classifications for predicated iteration to prevent matches">
<text></text>
</param>
<param name="@index@"
desc="Generator index" />
<param name="@index@"
desc="Generator index" />
<param name="@dim@" desc="Dim (optional)">
<text></text>
</param>
<param name="@dim@" desc="Dim (optional)">
<text></text>
</param>
<param name="@gensym@" desc="Generator TeX symbol">
<text></text>
</param>
<param name="@gensym@" desc="Generator TeX symbol">
<text></text>
</param>
<rate class="@class@" no="@no@" yields="@yields@"
gentle-no="true"
desc="Total {@yields@} premium">
<c:sum of="_CMATCH_" dim="@dim@" sym="@gensym@"
generates="@generates@" index="@index@"
desc="Set of individual {@yields@} premiums">
<c:product>
<c:value-of name="_CMATCH_" index="@index@"
label="One if {@class@} and not {@no@} (if provided), otherwise zero" />
<param-copy name="@values@" />
</c:product>
</c:sum>
</rate>
</template>
<rate class="@class@" no="@no@" yields="@yields@"
gentle-no="true"
desc="Total {@yields@} premium">
<c:sum of="_CMATCH_" dim="@dim@" sym="@gensym@"
generates="@generates@" index="@index@"
desc="Set of individual {@yields@} premiums">
<c:product>
<c:value-of name="_CMATCH_" index="@index@"
label="One if {@class@} and not {@no@} (if provided), otherwise zero" />
<param-copy name="@values@" />
</c:product>
</c:sum>
</rate>
</template>
</section>
</package>