I am trying to define a word; bagof which will collect subsequences of values that satisfy some constraints.
: bagof ( seq -- set-of-sub-sequences ) constraints-to-satisfy collect-the-sub-sequences ; Constraints might be anything but for example at the moment I want to collect the bag of integers for which the sum = some value. I would like to define the summing constraint using something like sum or foldl/r or reduce with map but I can't find a way to halt the summing process midway and test the constraint or repeat the function to build the outputs set. ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk