Using ranges, "iota rest" is just "[1,b)" (and more memory efficient because 
rest causes the virtual sequence to become concrete).

The filter-combinations word is more efficient than all-combinations [ ... ] 
filter because it can ignore or skip the ones that are not triples as it builds 
the result.

I'm glad the final version is so elegant!

Best,
John.

On May 22, 2013, at 1:56 AM, mr w <wzr...@gmail.com> wrote:

> <ajvond...@gmail.com> wrote:
>>> Oo, or even
>>> 
>>> 
>>> : triples ( n -- seq )
>>>    iota rest 3 [ first3 triple? ] filter-combinations ;
> 
> Out of all the examples given in several languages, this is by far the
> most concise version.
> 
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to