[Factor-talk] group-by word

2011-11-19 Thread missingfaktor
I want to write a word group-by that has following stack effect and behavior: Signature: : group-by ( seq quot -- alist ) (group-by-impl) ; Input: { hello hola ball scala java factor python } [ length ] group-by Output: H{ { 5 { hello scala } } { 4 { hola ball java } } { 6 { factor

Re: [Factor-talk] group-by word

2011-11-19 Thread P.
Do it step by step - think about the steps you need to take. I would first sort the array by length. Then I would group them by length (look at the monotonic-split word for that). That would be very close to what you want. On Nov 19, 2011, at 12:49 PM, missingfaktor wrote: I want to write a

Re: [Factor-talk] group-by word

2011-11-19 Thread Joe Groff
You can look at math.statistics:collect-by as a reference: USE: math.statistics { hello hola ball scala java factor python } [ length ] collect-by -- All the data continuously generated in your IT infrastructure

Re: [Factor-talk] group-by word

2011-11-19 Thread John Benediktsson
You might also be interested in this blog post, which walks through how to build a group-by word: http://re-factor.blogspot.com/2011/04/group-by.html On Sat, Nov 19, 2011 at 10:19 AM, Joe Groff arc...@gmail.com wrote: You can look at math.statistics:collect-by as a reference: USE: