Hi all,
The following comes up often in Factor source:
: (foo) A [ B , (foo) ] when ;
: foo [ (foo) ] { } make ;
I was thinking of making a combinator:
[ A ] [ B ] { } make-while
We can implement it using while:
: while ( pred quot -- )
dupd 2slip rot [ tuck 2slip while ] [ 2drop ] if ; inline
: make-while ( pred quot exemplar -- )
>r [ , ] compose [ while ] 2curry r> make ; inline
Any thoughts? Is there a better name than 'make-while' for this?
Slava
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk