dyna
dyna copied to clipboard
implement prefix aggregators
I really find myself wanting prefix aggregators already, so that I don't have to introduce too many new names. This is particuarly true for queries, where they're just throwaways anyway:
query max= count(Word). % most frequent word
Here's a fancy example involving a nested pair of aggregators:
query argmax= [(+= 1 for brown(Sentence,Position)), Sentence].
% length and ID of longest sentence
This assumes that the prefix form of argmax=
returns a pair, as in the design suggested in this https://github.com/nwf/dyna/issues/29#issuecomment-20404238 comment.