Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-08-30 11:21:50 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-09-11 09:30:50 -0400
commit7e1b0c6d0d05040c87cb08a3aaeb8e01073d12fb (patch)
treee042c671fc81077bafeb6cd3d28b8978b3d1ae14
parent2b72a21b848e846dac949b3fbfe9c19e3d55efe1 (diff)
downloadtame-7e1b0c6d0d05040c87cb08a3aaeb8e01073d12fb.tar.gz
tame-7e1b0c6d0d05040c87cb08a3aaeb8e01073d12fb.tar.bz2
tame-7e1b0c6d0d05040c87cb08a3aaeb8e01073d12fb.zip
Add _repeat-value_ template
* vector/common.xml (_repeat-value_): Add template.
-rw-r--r--core/vector/common.xml30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/vector/common.xml b/core/vector/common.xml
index 367b86d..dc68cfb 100644
--- a/core/vector/common.xml
+++ b/core/vector/common.xml
@@ -166,6 +166,36 @@
</function>
+ The template \ref{_repeat-value_} will generate a vector from the
+ given value for each class match.
+
+ <template name="_repeat-value_"
+ desc="Repeat value for each class match">
+ <param name="@values@" desc="Calculation producing value (use
+ one of this or @value@)" />
+ <param name="@class@" desc="Classification to consider" />
+ <param name="@value@" desc="Value to repeat (use one of this
+ or @values@)" />
+ <param name="@generates@" desc="Result value (vector)" />
+
+ <!-- if providing @values@ -->
+ <param name="@index@" desc="Generator index">
+ <text>__k</text>
+ </param>
+
+
+ <rate-each class="@class@"
+ generates="@generates@" index="@index@">
+ <if name="@values@">
+ <param-copy name="@values@" />
+ </if>
+ <unless name="@values@">
+ <c:value-of name="@value@" index="@index@" />
+ </unless>
+ </rate-each>
+ </template>
+
+
<!-- generates a variable that can be recognized as an empty set (useful for
defaults to params that require sets) -->
<rate-each class="always" yields="__empty" generates="__emptySet" index="k">