Scalaã®ç¹å¾´ãç´¹ä»ããåºæ¬æ§æãé¢æ°ã ã¯ã©ã¹ãªã©ãScalaã®åºæ¬çãªæ©è½ã«ã¤ã㦠解説ããå ¥éé£è¼ Eclipseã§Scalaããã°ã©ãã³ã°ãå§ããããã®åºç¤ ã¹ã±ã¼ã©ãã«ã§é¢æ°åã§ãªãã¸ã§ã¯ãæåãªScalaå ¥éï¼1ï¼ãæ¦è¦ã5ã¤ã®ç¹å¾´ãç´¹ä»ããéçºç°å¢ãæ§ç¯ãã¦å¯¾è©±åå®è¡ç°å¢ãREPLããEclipseä¸ã§Hello Worldãå®è¡ãã¾ã
ãµã³ãã«ããã¸ã§ã¯ãã§ã¯å§ããã2ã¤ã®ãã¥ã¼ãå®ç¾©ãããã¡ã¤ã«ãä½æããã¾ãããã¥ã¼ãã¡ã¤ã«ã¯app/viewsã®ä¸ã«ç½®ãã¾ãããã¡ã¤ã«åã¯ã.scala.htmlãã§çµããæ¡å¼µåã®å称ãä»ãã¾ãã ãµã³ãã«ããã¸ã§ã¯ãã®ãã³ãã¬ã¼ãã®æ©è½ã¯ç°¡åã«èª¬æããã¨ä»¥ä¸ã®éãã§ãã index.scala.html ãhttp://localhost:9000/ãã®ãªã¯ã¨ã¹ãã®çµæã表示ããããã®ãã³ãã¬ã¼ã main.scala.html index.scala.htmlããå¼ã³åºããããã³ãã¬ã¼ã ãªãååã®é£è¼ã§æ¸ãç´ãããã®ã¯ããããã®ãã³ãã¬ã¼ãã使ç¨ãã¦ãã¾ããããã³ãã¬ã¼ãã使ç¨ããããã«ã¯Applicationã¯ã©ã¹ã®indexã¡ã½ããã®æ»ãå¤ã«æ°ãä»ããå¿ è¦ãããã¾ããååä¿®æ£ããã¨ãã¯æ»ãå¤ã«ç´æ¥è¡¨ç¤ºãããæååãè¨å®ãã¾ããã
åæ¸ã Scalaã¨ããè¨èªããåç¥ã§ããï¼ Javaã¨åããã³ã³ãã¤ã«ãããã¨classãã¡ã¤ã«ã«ãªããå®è¡æã¯JVMä¸ã§åä½ããããªãã¸ã§ã¯ãæåï¼é¢æ°åã®ããã°ã©ãã³ã°è¨èªã§ãã Scalaãéçºããã®ã¯Javaã®genericsã®è¨è¨ãæãããããjavacã®éçºããã¦ããçµæ´ãæã¤Martin Oderskyæ°ã Scalaã¯å¾çºã®è¨èªã¨ãããã¨ããã£ã¦ãJavaãæ¸ãã¦ããæã«æããåé·ãã«å¯¾ããæ§ã ãªè§£ãç¨æããã¦ãã¾ãã æ¬è¨äºã§ã¯ãScalaã¨Javaã®ã³ã¼ããæ¯è¼ããªãããJavaã¦ã¼ã¶ãScalaã«ç§»ã£ãéã«å¾ãããã¡ãªãããæ示ãã¦ããã¾ãã å°ãåºç¤ã®ãµã³ãã«ã³ã¼ãã¯Javaã¦ã¼ã¶ã«ä¼ãããããããã«ãreturnãæè¨ããããã¡ã½ããã¯å¿ ã{ }ã§å²ããªã©ã極åJavaã£ã½ãè¨è¿°ããã¦ãã¾ãã ã ãããJavaã¨åããããªæ¸ãæ¹ãã§ãã¾ã Scalaã¯Javaã®
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}