On Wed, Jan 9, 2013 at 11:32 PM, John Benediktsson <mrj...@gmail.com> wrote:

>
>
> If you want to flatten, you could do this:
>
>     IN: scratchpad { { 1 2 } { 3 4 } } concat .
>     { 1 2 3 4 }
>
> If you want to just check the rows for membership, you could do this
> (which checks if any of the rows contained in the matrix contain the a
> particular number):
>
>     IN: scratchpad 5 { { 1 2 } { 3 4 } } [ member? ] with any? .
>     f
>
>     IN: scratchpad 3 { { 1 2 } { 3 4 } } [ member? ] with any? .
>     t
>
> Your "contain a number greater than n" check might be:
>
>     IN: scratchpad 5 { { 1 2 } { 3 4 } } [ [ < ] with any? ] with any? .
>     f
>
>     IN: scratchpad 3 { { 1 2 } { 3 4 } } [ [ < ] with any? ] with any? .
>     t
>
> These might look "cleaner" if you re-ordered it and used fry notations (or
> not, just an idea):
>
>     IN: scratchpad { { 1 2 } { 3 4 } } 5 '[ _ swap member? ] any?
>
>     IN: scratchpad { { 1 2 } { 3 4 } } 5 '[ [ _ > ] any? ] any?
>

Cheers.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to