Created
May 9, 2012 09:35
-
-
Save cataska/2643333 to your computer and use it in GitHub Desktop.
Trivial function composition example in factor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USING: kernel io sequences math math.ranges namespaces arrays | |
prettyprint ; | |
IN: aboveAndDiv2 | |
: above60 ( seq -- seq ) | |
[ 60 >= ] filter ; | |
: div2 ( seq -- seq ) | |
[ 2 / ] map ; | |
: above60AndDiv2 ( seq -- seq ) | |
[ above60 ] [ div2 ] compose call ; | |
: testIt ( -- x ) | |
65 [1,b] above60AndDiv2 ; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment