Re: [Factor-talk] Stack Depth

2012-06-19 Thread Marshall Lochbaum
I figured there would be a word designed for that already... Here's my take on this anyway. I would append the items to a sequence as the algorithm goes along: { } swap [ dup 1 > ] [ dup 2 /i [ suffix ] dip ] while suffix accomplishes the task. Marshall On Tue, Jun 19, 2012 at 10:50 PM, Graham

Re: [Factor-talk] Learning Factor - string, array and io handling - beginner

2012-03-10 Thread Marshall Lochbaum
group in the grouping vocabulary splits a sequence into subsequences, like this: ( scratchpad ) { 3 6 2 5 8 7 } 2 group . { { 3 6 } { 2 5 } { 8 7 } } It would be a good idea to first flatten the list and then run 2 group on it. Marshall On Sat, Mar 10, 2012 at 7:44 AM, Robert Herman wrote: >

Re: [Factor-talk] Factor for Dummies

2012-02-18 Thread Marshall Lochbaum
In terms of tools to use, the listener is for interactive evaluation. Since Factor programs are often short enough to fit on a few lines, you can type them into the listener and see what they do. Programming in a concatenative language is very different. You certainly don't want to think in terms

Re: [Factor-talk] ternary-search-tries confusion

2011-12-11 Thread Marshall Lochbaum
2drop should have stack effect ( x y -- ) . I have no idea why it should refuse to do that in the compiler. Maybe try replacing it with drop drop ? Marshall On Sun, Dec 11, 2011 at 3:13 AM, CW Alston wrote: > Greetings, Factorials - > I've been working through mrjbq7's re-factor utilities, part