MochiKit.Iterã®ãµã³ãã«ã³ã¼ããèªã MochiKit.Iterã®ããã¥ã¡ã³ãã®ãµã³ãã«ã³ã¼ããããã©ãã©ã«ãã¦è¦ã¦ããã¾ãã 以ä¸ã¯2ã®åæ°ãã¤ãã10æªæºã®éç¹°ãè¿ããåç®ããã³ã¼ãã§ãã theSum = sum(takewhile( partial(operator.gt, 10), imap( partial(operator.mul, 2), count() ) )); ok( theSum == (0 + 2 + 4 + 6 + 8) ); operator operatorã¯åç´æ¼ç®é¢æ°ç¾¤ãä¿æãããªãã¸ã§ã¯ãã§ãã gt(a, b)ã¯ãa > bãè¡ãçå½å¤ãè¿ãã¾ãã mul(a, b)ã¯ãa * bãè¡ãªãçµæå¤ãè¿ãã¾ãã ok(operator.gt(1, 10) == false); ok(operator.gt(10, 1) == true);
{{#tags}}- {{label}}
{{/tags}}