Re: [Factor-talk] Constraints on sequence functions

2013-06-04 Thread Doug Coleman
How about [ sum 100 = ] filter
On Jun 4, 2013 9:57 PM, "graham telfer"  wrote:
>
> Maybe happiness! Perhaps the math.combinatorics vocabulary has what I
need.
>
> Sent from my iPad
>
> On 5 Jun 2013, at 12:45, "graham telfer"  wrote:
>
> > 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
--
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


Re: [Factor-talk] Constraints on sequence functions

2013-06-04 Thread graham telfer
Maybe happiness! Perhaps the math.combinatorics vocabulary has what I need.

Sent from my iPad

On 5 Jun 2013, at 12:45, "graham telfer"  wrote:

> 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


[Factor-talk] Constraints on sequence functions

2013-06-04 Thread graham telfer
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