Kotlinã®é¢æ°ãªãã©ã«ã¯ãã®å¼æ°ãå¯ä¸ã¤ã ãã®å ´åãæé»ã®å¼æ°ã¨ãã¦itã使ç¨ã§ããã®ã¯ã¿ãªãããåç¥ã ã¨æãã¾ã(æé»ã®å¼æ°ã¨ããè¨èã¯æ£ç¢ºãããªããããªæ°ããããã©æ°ã«ããªã)(ç¥ããªã人ã¯å ¬å¼ããã¥ã¡ã³ããä»æ¥çºå£²ã®SoftwareDesignãè¦ãã¨ããã)ã listOf(1, 2, 3, 4, 5) .filter { n -> 2 < n } // å¼æ°ãæ示ãããã¨ã .map { it * 2 } // itã使ããã¨ãã§ããã .let { println(it) } // => [6, 8, 10] Scalaã£ã½ã Scalaã®é¢æ°ãªãã©ã«ã®æé»ã®å¼æ°ã¯ãè¤æ°ã®å¼æ°ã«å¯¾å¿ãã¦ãã¾ãããããã_ã§åç §ãããã¨ã«ãªãã¾ãããåç §ãããã³ã«ç¬¬ä¸å¼æ°ã第äºå¼æ°ã®ããã«å¤åãã¾ãã // Scala Seq(1, 2, 3).reduce(_ + _) ããããæãã®æé»
{{#tags}}- {{label}}
{{/tags}}