2016-02-13
/ scala
åã«ãšã£ãŠ ScalaMatsuri ãšã¯ã©ã€ãã¹ã¿ã€ã«ã®ãããªãã®ã (ä»ã® 27åè¿ããããªãŒã¬ãã€ã¶ãŒãåãããã«æã£ãŠããããããªãã ããã)ã確ãã«ãè¿æ¥æ±äº¬ã§ 550åãåå¡ããã«ã³ãã¡ã¬ã³ã¹ããã£ãŠãããã¯æåã«çµãã£ãããããããªãŒã¬ãã€ã¶ãŒã¯ 2015幎㮠2/28 ãããããã 11ã¶æéæºåããŠãããåãé¢ãã£ãã®ã¯äžéšã§ãããªããã©ããScalaMatsuri 2016 ã¯ãããŸã§ã§äžçªé¢ããã®æ·±ãã«ã³ãã¡ã¬ã³ã¹ã«ãªã£ããšæãããã®äœã¶æã®é SlackãHangout ããŸã«ã¯å¯Ÿé¢ã§ãããŸããŸãªè°è«ãéããŠãããé¢çœãã£ãã®ã¯ãäžç·ã«ã¢ã€ãã£ã¢ãåºãåã£ãŠãããå®çŸãããã®ãã¿ãããšã ã£ããšæããåãå¥æãªã¢ã€ãã£ã¢ãåºããŠããã®è©³çŽ°ã誰ããå®è¡ããŠãããããšãããã°ãä»ã®äººãå§ããããšãå
ã«åãçŸå Žã®äœæ¥ãããããšããã£ãã
è²ã
èšãããããšã¯ãã°ããŒãã«ãªæè¡ã«ã³ãã¡ã¬ã³ã¹ããšãæ¥æ¬ã®ã³ãã¥ããã£ã®äº€æµãã®äž¡ç« ã§ãæžãã¡ãã£ãã®ã§ããã¶ãéšåããããšæãã
2015幎3æ
2015幎㮠3/16 ã®æ®µéã§æ¢ã« ScalaMatsuri 2015 ã®æºåã¯åãå§ããŠãããäœæ
èŠããŠããããšãããšããã¯éº»æ€ãã (@oe_uia ) ãæ³è¢«ãæ¥ãŠ Scala Days San Francisco ã«ç»å Žããããã ãã«ã³ãã¡ã¬ã³ã¹ãšäžç·ã«ã¹ããŒãã¹ãããã§ããããã«ãšããããšã§ããã®å Žã®é°å²æ°ã§ 2016幎㮠1æã«ãããããšããã¢ã€ãã£ã¢ãçãŸããã
ããã«è¡ã¯ Scala Days ã®äŒå Žããå°ãæ©ãæã«ãã£ãŠãã®åž°ãéã§éº»æ€ãããš CFP ãå
¬éããŠåºå®è²»ã§æ
è²»ãµããŒããä»ããããšãã話ãããã®ãèŠããŠãããããã¯å°ãªããšã 2014幎 (ã«ã³ãã¡ã¬ã³ã¹ã§ã®ãŠãããŒãµã«ã»ã¢ã¯ã»ã¹ãžåã㊠) ãããããèããŠãã¢ã€ãã£ã¢ã§ãéå
¬éã§èª°ããæåŸ
ããŠãã®äººéã®æ
è²»ãæãã®ã«æ¯ã¹ãŠããã€ãã®å©ç¹ããããšæã£ãŠãããã«ã³ãã¡ã¬ã³ã¹ã延æããããšã§ä»¥åããé·ãæºåæéãåŸãããšãã§ããã®ã§ããã£ãŠã¿ãèŠèŸŒã¿ããã£ãã
Github issue all the things
ä»åãã以åã®ã«ã³ãã¡ã¬ã³ã¹æºåã§äœ¿ãããŠãã Trello ã co-meeting ãã Slack ãš Github issue ã®çµã¿åããã«ä¹ãæããã
äž¡è
ã¯ãããããè£å®ããé¢ä¿ã«ãã£ãŠããã決æã ã£ããšæããã©ãã«ã䜿ã£ãŠ issue ãæ
åœããŒã ã«å²ãåœãŠããšããéçšãããŠããŠããããããŸããã£ãŠãããšæãã
å°ããã¿ã¹ã¯ã倧éã«ã§ããŠã㊠Github issue ã§å°ã£ãã®ã¯ãç¹å®ã®ã¿ã¹ã¯ãä»ã©ãããç¶æ³ã«ããã®ããææ¡ããã®ãé£ãããšããããšã ã£ããäœããèµ·ããã®ãåŸ
ã£ãŠããã®ãããããã¯èª°ããäœæ¥äžãªã®ãããšãã£ãããšã ãissue ã® subject ã«æ¬åŒ§æžãã§ããã»ã¹ããŒã¿ã¹ãæžããšããããšããã£ãŠã¿ããã©ãã翻蚳ã¿ã¹ã¯ãªã©äºåã«æ確ã«ã¹ããããå®çŸ©ãããŠããã¿ã¹ã¯é¡ã«é¢ããŠã¯ãã®æ¬åŒ§æžãæ¹åŒã¯ããŸããã£ããšæãã
2015-10-06
/ scala
ScalaMatsuri éå¶ããã°ã«ãã°ããŒãã«ãªæè¡ã«ã³ãã¡ã¬ã³ã¹ããšãæ¥æ¬ã®ã³ãã¥ããã£ã®äº€æµãã®äž¡ç« ãæžããŸããã
2015-09-30
/ scala
Scala ã¯æè»ãªããã°ã©ãã³ã°èšèªãªã®ã§ãå人ç㪠Good Parts ã®ãããªèšèªã®ãµãã»ããããããã¯äž»çŸ©äž»åŒµã®ããã¹ã¿ã€ã«ã¬ã€ããäœãããšã¯æçšã ã
ã»ããã¢ãã
-Yno-lub
ãè©ŠããŠã¿ãã人ã¯ã以äžã project/ynolub.sbt
ã«æžã㊠sbt ãã©ã°ã€ã³ãåŒã£åŒµã£ãŠãã:
addSbtPlugin( "com.eed3si9n" % "sbt-ynolub" % "0.2.0" )
lub
Scala ã®åæšè«ãå A
ãšå B
ãçµ±åãããšãããããã® <:<
ã«é¢ãã lub (least upper bounds, æå°äžç) ãèšç®ããããã®éçšã lubbing ãšåŒã¶ããšããããå
·äœäŸã§èª¬æãã:
scala> if ( true ) Some ( 1 ) else None
res0: Option [ Int ] = Some ( 1 )
scala> if ( true ) List ( 1 ) else Nil
res1: List [ Int ] = List ( 1 )
Read MoreâŠ
2015-05-03
ç«çª ãšããæ°ããã·ãªãŒãºãå§ããã(ããã¯æåãã Pamflet ã§æžããŠãã)
Cats 㯠Scala ã®ããã®é¢æ°åããã°ã©ãã³ã°ã®ã©ã€ãã©ãªã§ãããã¯åãããã䜿ã£ãŠã¿ãèšé²ã ã Cats ã¯ãçŸåšéçºäžã§æªã å®éšæ®µéã«ããã
2015-02-19
/ scala
æè¿ Mac ãš Ubuntuããããã Java 6 ãš Java 7 ãè¡ã£ããæ¥ããããŠãã
Java ã®åãæ¿ãæ¹ãçµ±äžãããã®ã§ãããã«ã¡ã¢ããŠããã
è¿œèš : jEnv ãšãã䟿å©ãªãã®ã Yoshida-san ã«æããŠããã£ãã®ã§ãããã䜿ã£ãã»ããããããã
Zshrc
OS ã«ããã·ã§ã«ã¹ã¯ãªããã®åãæ¿ãã¯ãããªãµãã«ãã£ãŠã:
## basic
[ -f $HOME/dotfiles/zshrc.basic ] && source $HOME/dotfiles/zshrc.basic
## aliases
[ -f $HOME/dotfiles/zshrc.alias ] && source $HOME/dotfiles/zshrc.alias
case "${OSTYPE}" in
# MacOSX
darwin*)
[ -f $HOME/dotfiles/zshrc.osx ] && source $HOME/dotfiles/zshrc.osx
;;
# Linux
linux*)
[ -f $HOME/dotfiles/zshrc.linux ] && source $HOME/dotfiles/zshrc.linux
;;
esac
## color
[ -f $HOME/dotfiles/zshrc.color ] && source $HOME/dotfiles/zshrc.color
Read MoreâŠ
2015-02-07
/ scala
pickling 0.10.0 ãšã㊠implicit.ly ã«æçš¿ãããã®ãèš³ããŸããã
æè¿ã³ããã¿ãŒæš©ãããããŸããããPickling ã® 90% 以äžã¯ Eugene BurmakoãHeather MillerãPhilipp Haller ã«ãã£ãŠæžãããŠããŸãã
Scala Pickling ã¯ãScala ã®ããã®èªåã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ã»ãã¬ãŒã ã¯ãŒã¯ã§ã0.10.0 ãåã®å®å®çãšãªããPickling ã¯é«éã§ããã€ã©ãŒãã¬ãŒã (åé·ãªã決ãŸãã³ãŒã) ç¡ãã§æžãããšãã§ãããŠãŒã¶åŽã§ (ãã€ããªã JSON ãªã©ã®) ã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ã»ãã©ãŒããããç°¡åã«å·®ãæ¿ããããšãã§ããããŸãã0.10.x ã·ãªãŒãºäžã¯ãã€ããªäºææ§ãšãã©ãŒãããã®äºææ§ã®äž¡æ¹ãä¿ã€äºå®ã ã
Pickling ãçããŸãšãããš
ããä»»æã®å€ãäŸãã°ãPerson("foo", 20)
ã pickle ãã (ã·ãªã¢ã©ã€ãºåãä¿åé£ã«å©ããŠã挬ç©ã«ã挬ããããšèšã) ãšãã以äžã® 2ã€ã®ãã®ãå¿
èŠã«ãªã:
äžããããå Person
ã® pickler ã³ã³ãããŒã¿
pickle ãã©ãŒããã
Pickler[A]
㯠A
ããšã³ããªãŒ ããã£ãŒã«ã ãã³ã¬ã¯ã·ã§ã³ ãšãã£ãæœè±¡çãªãã®ã«å解ããããšãæ
åœãããããªããã£ã㪠pickler ãåæããŠè€åç㪠pickler ãäœãããšãã§ãããããã³ã³ãããŒã¿ãšåŒã°ããŠãããäžæ¹ PickleFormat
ã¯ãã£ãŒã«ã ãªã©ã®æœè±¡çãªæŠå¿µããã€ããªãããã¹ããšãã£ã圢ã«å
·çŸåããã
Defaults ã¢ãŒã
以äžã¯åºæ¬åœ¢ã§ãã Defaults
ã¢ãŒãã®äœ¿çšäŸã ã
2014-10-20
/ fp
Uppsala ããåž°ã£ãŠããéäžãäœãšãªãæãåºããã®ã¯ååãšã®ã¢ããã®çŽèŠ³ã«ã€ããŠã®äŒè©±ã§ãåã¯é
·ã説æãããæ°ããããè²ã
èããŠãããã¡ã«ãã¡ãã£ãšã²ãããããã£ãã
ã¢ããã¯ãã©ã¯ã¿ã«ã
äžã®ãã©ã¯ã¿ã«ã¯ã·ã§ã«ãã³ã¹ããŒã®äžè§åœ¢ãšåŒã°ãããã®ã§ãåãããã§æããå¯äžã®ãã©ã¯ã¿ã«ã ããã©ã¯ã¿ã«ãšã¯èªå·±çžäŒŒçãªæ§é ã§ãäžã®äžè§åœ¢ã®ããã«éšåãå
šäœã®çžäŒŒãšãªã£ãŠãã (ãã®å Žåã¯ã芪ã®äžè§åœ¢ã®ååã®ã¹ã±ãŒã«ã®çžäŒŒ)ã
ã¢ããã¯ãã©ã¯ã¿ã«ã ãã¢ããã£ãã¯ãªããŒã¿æ§é ããããšãããã®å€ã®ããã€ããåæããŠåãããŒã¿æ§é ã®æ°ããå€ã圢æããããšãã§ããããããã¢ãããããã°ã©ãã³ã°ã«æçšã§ããçç±ã§ããããŸãå€ãã®å Žé¢ã§ç»å Žããçç±ã ã
å
·äœäŸã§èª¬æãã:
scala> List ( List ( 1 ), List ( 2 , 3 ), List ( 4 ))
res0: List [ List [ Int ]] = List ( List ( 1 ), List ( 2 , 3 ), List ( 4 ))
2014-09-14
/ scala / conference
2æ¥éã® #ScalaMatsuri ã¯çæ³ã«çµãã£ããã ãã©ãæ¥å¹ŽãžåããŠè²ã
課é¡ãããã®ã§ããããèªåãªãã«æžãåºããŠã¿ããé¡ã®éããåéã®æ¬¡ã®ç®æšãšããã¹ããã®ã¯ãŠãããŒãµã«ã»ã¢ã¯ã»ã¹ã ãšèããŠãããScala èšèªã«ãããŠã¯ãçµ±äžã¢ã¯ã»ã¹ã®åå (universal access principle) ãšèšãã°ãã¡ãœãããšãã£ãŒã«ãã®äž¡æ¹ãå€åŽããèŠããšå¥ããžã ãŠç¡ãã¢ã¯ã»ã¹ã§ããããšãæãã
ãã®æèã§ã®ãŠãããŒãµã«ã»ã¢ã¯ã»ã¹ã¯ãæ§ã
ãªã°ã«ãŒãã®äººã«ãšã£ãŠãå
æ¬ç (inclusive) ãªã«ã³ãã¡ã¬ã³ã¹ãšããæå³ã§äœ¿ã£ãŠãããå
·äœçã«ã¯:
女æ§/ç·æ§/ããã/LGBT ã®ããã°ã©ã
æ¥æ¬èª/è±èªè©±è
åå¿è
ãšäžçŽè
ãã¹ãã¯ãªã©ã®ç 究è
æ¥æ¬ä»¥å€ã®ã¢ãžã¢è«žåœããã®äºº
ãªã©ã
ãã¯ãããžãŒçã«ããã女æ§åé¡ãåã³ãã®ä»ã®ãžã§ã³ããŒåé¡
å»å¹Žã¯å¥³æ§ã«ããã»ãã·ã§ã³æ°ã¯ãŒããä»å¹Žã¯ããã¯ãã«é¢ããŠã®ã»ãã·ã§ã³ãäžã€ãšãFuRyu ããã®ã¹ãã³ãµãŒ LT ãäžæ¬ãã£ããããã¯è¯ãåŸåã ãšæããã©ãåãšããŠã¯ã女æ§ã®äººã«ãã Scala ã³ãã¥ããã£äžè¬ãžã®åå ãå匷äŒãªã©ãžã®åºåžããã㊠ScalaMatsuri ã®ãããªã«ã³ãã¡ã¬ã³ã¹ãžã®åºåžããã£ãšå¿æŽããããšæããç·æ§åŽãšããŠã§ããããšã®äžã€ã«ãããå匷äŒã«åå ããŠããã女æ§ã®æ¹ãããããå€ãªæåãåããã«æ®éã®ããã«ãŒã®äžäººãšããŠæ¥ããããšããããšæãã
Scala DaysãNE Scalaããã㊠PNW Scala ã«å£ã£ãŠãä»å¹Žã® ScalaMatsuri ã§ã¯ Geek Feminism Wiki/Ada Initiative ãåæ¡ãšããè¡åèŠç¯ ãæ¡çšããããã®è¡åèŠç¯ã¯ãå
šå¡ã«ãã©ã¹ã¡ã³ãã»ããªãŒã®çµéšãæäŸããããšãçŽæããç¹ã«ãå
šãŠã®ã³ãã¥ãã±ãŒã·ã§ã³ã¯ãæè¡çãªçºè¡šã®å Žã«ãµãããããã®ã§ããã¹ããããšãæ±ãããä»åŸãæ£åŒãªãã©ã¹ã¡ã³ãå ±åæ¹æ³ã®ç¢ºç«ãªã©ãå«ããããªã·ãŒã®å®è£
ãã¯ã£ãããããå¿
èŠãããããå
¬çã«ãã®ãããªã¬ã€ãã©ã€ã³ãæ¡çšã§ããããšã§ããã inclusive ãªã«ã³ãã¡ã¬ã³ã¹ã«ãªã£ãŠãããšèããŠããã
èšèªã®å£
Scala ããã䜿ãããŠãããã®ä»ã®æ¬§ç±³è«žåœã«æ¯ã¹ãŠãæ¥æ¬ã®è±èªã¹ãã«ã¯ç¹ã«ãªã¹ãã³ã°ãšã¹ããŒãã³ã°ã§é
ããŠãããScalaMatsuri ã®éå¶åŽãšããŠã¯ãã«ã³ãã¡ã¬ã³ã¹ãããå°ã£ããã®ã«ããŠãScala ã³ãã¥ããã£ããããå€ãã®è±èªè©±è
ãæ¹ãã€ããããšãç®æšã®äžã€ãšããŠãããããã«æ²¿ã£ãŠãæåŸ
è¬æŒè
ã®æ
è²»ãåºããããããã¹ã翻蚳ãæäŸããããäžè¬çã«è±èªè©±è
ãæ¥ãŠã楜ãããããã«æè¿ããããã«ããŠãããä»å¹Žã¯ãæ¥æ¬èªè©±è
ã§ãè±èªã§çºè¡šãã人ãåºãŠããã
ãã®ãããªåªåã¯ãScala ã«ã¯èå³ããããè±èªã¯èŠæãšããå€ãã®ã«ã³ãã¡ã¬ã³ã¹åå è
ã«ãšã£ãŠå©å®³é¢ä¿ã®è¡çªãšãªãããªã¢ã«ã¿ã€ã ã§æäŸãããæå¿ã«ããããã¹ã翻蚳ã¯ãç¡ãããã¯ãããããããªããã©ãåŸã
ã«ããŠäžååã§ããã解決æ¹æ³ãšããŠæ€èšããã¹ãã¯ããã®éèš³ãéãããšã ããã㯠YAPC::Asia ãªã©ã§ã¯ããŸããã£ãããããããã«ã2ã€ã®å¥è·¯ç· (track) ãäœã£ãŠãããããè±èªã§ã®çºè¡šãšæ¥æ¬èªã§ã®çºè¡šãè¡ãã¹ãã ã
åå¿è
ãšäžçŽè
Matsuri ã¯ç¥ãšããæå³ã§ãããŒãã “enjoy Scala” ã ã£ããåãã Scala ããã£ãŠããŠããŠãŒã¶ã«ã¯ç¢ºãã«æ¥œããã«ã³ãã¡ã¬ã³ã¹ã ã£ããããããªãããåã®ãã®ãå«ãå€ãã®ããŒã¯ã¯åå¿è
ã眮ããŠããŒãã«ãããã®ãšãªã£ãããã®åé¿æ¹æ³ãšãªãåŸããããããªãã®ããè±èªè·¯ç·ãšæ¥æ¬èªè·¯ç·ã®åºå¥ã®ä»ã«ãNE Scala ã®ããã«ã»ãã·ã§ã³ãåå è
ã®æ祚ã§æ±ºããŠãããããšã ãïŒéèš³ä»ãã§ïŒè±èªã®ã»ãã·ã§ã³ã§ãèããŠã¿ãã人ãšäžçŽè
ãéã«æ¥æ¬èªã«ããŠæ¬²ãã人ãšåå¿è
ã«çžé¢æ§ããããšä»®å®ãããšãããããã®è·¯ç·ããæ祚ã«ãã£ãŠèŽè¡ãèãããé©åãªã¬ãã«ã«è£æ£ãããã®ã§ã¯ãªãã ãããã
2014-09-13
/ scala
æ¥æ¬ã§ã® Scala ã«ã³ãã¡ã¬ã³ã¹ãä»å¹Žã§äºå¹Žç®ã ãä»å¹Žã¯ ScalaMatsuri ãšååãå€ããŠä»åãçŽãã300æã®ãã±ããã¯å£²ãåããæåŸ
è¬æŒè
ãã¹ãã³ãµãŒæåŸ
æ ãªã©ãå
¥ãããåœæ¥ã¯ãã£ãšãããããããªããã¢ã¡ãŒãããã°ããªã³ã©ã€ã³åºåãµãŒãã¹ãªã©ãäºæ¥ãšãã CyberAgent ããã®ãªãã£ã¹ãäŒå ŽãšããŠãåãããã
1æ¥ç®ã®ãããããã¿ãŒã¯å°ç°å¥œå
çããš Martin Odersky å
ç (@ordersky ) ã®ãScala é²åè«ããå€ãã®äººãå°ç°å¥œå
çã®è¬æŒã楜ãã¿ã«ããŠããã®ã§ãæããæºå¡ã«è¿ãã£ããšæããåãåºåžããã»ãã·ã§ã³ã¯ãæäœã® closed-captioning ã䜿ã£ãŠåè±ãè±åã®ããã¹ã翻蚳ãæã¡èŸŒãã®ã«å¿ããã£ããäžæ¥ç®ç¿»èš³ããŒã ã®ä»ã®ã¡ã³ããŒã¯ã@cbirchall ã @cdepillabout ã @okapies ã @oe_uia ã
次ã«åããsbtãåŸåãšå¯Ÿçããæ¥æ¬èªã§è©±ãããmkdir helloworld ããå§ããŠãsbt ã®æåã®ã¹ããããããcontinuous testing ãŸã§ã®æµãã®ãã¢ããå§ããã次ã«ãåºç€ã³ã³ã»ããã0.13.6 ã§å
¥ãæ°æ©èœã§ãã HTTPS ããã©ã«ããconsolidated resolutionãeviction warning ã玹ä»ããŠãæåŸã«ããµãŒããšããŠã® sbtããšãããªãæ§èœã®æ¹åãšããå°æ¥ã®å±æã§ã·ã¡ããLinkedIn瀟ã®ãã¬ã¹ããŒã ãããLinkedIn ã
sbt ã®æ§èœæ¹åã®ä»äºãã¹ãã³ãµãŒããŠããã£ãŠãããšã話ããŠãããèš±å¯ãããã£ãŠããã®ã§ãä»åæ©èœæ¹åã«é¢ããŠå
¬ã®å Žã§ã瀌ã§ããã®ã¯è¯ãã£ããšæãã
Activator ãš sbt ã«é¢ããŠè³ªåããã£ããActivator ã® 3ã€ã®çšäŸãšããããšã§ä»¥äžã®ããã«åçãã:
ãã¬ãŒãã³ã°ã»ã»ãã·ã§ã³ãªã©ã«ããã USBãã©ã€ããªã©ã«ãã Typesafe ã¹ã¿ãã¯ã®ãªãã©ã€ã³é
åž
æ°ãŠãŒã¶ã® out-of-the-box ãšã¯ã¹ããªãšã³ã¹ (ç®±ãéããŠããéã¹ãããš) ã®æ¹å
ãŠãŒã¶ãã³ãŒããæã¡èŸŒã¿ãªãã䜿ãããã¥ãŒããªã¢ã«ããã¹ããããã©ãããã©ãŒã
sbt ãµãŒãã«é¢ããŠã¯ãIntelliJ ãªã©ã®ä»ã®ããŒã«ãšã®é£æºããšå°æ¥ç㪠remote compilation ãªã©ã®å¯èœæ§ãã§ããããšäž¡æ¹ã«ã€ããŠå¥œåå¿ãåŸãã
2014-05-26
å人çã«ã¯ SublimeText ã§ç¹ã«å°ã£ãŠããªãããã¡ã€ã³ã®ãšãã£ã¿ãšããŠãã°ãã䜿ã£ãŠãããã ãã©ãã³ãã³ãã©ã€ã³ãã䜿ãããšãã£ã¿ã«ãå°ãã¯èå³ãããããè²ããªäººããããã¯ãŒã¯äžãã䜿ãããã䟿å©ãšããããšãèšã£ãŠãããX ã転éããããä»ã®æ¹æ³ã§ãªã¢ãŒãã€ã³ããã° Sublime ã䜿ããããããªãããšãæãããäžå¿è©ŠããŠã¿ããã
ãã® Vim ã®ã»ããã¢ãããããããšæã£ãããã«ã±ã®äžã€ã«æ°ãã MBP ãè²·ã£ããšããã®ããã£ãŠãæè§ã ããäœãæ°ããããšããã£ãŠã¿ããããªãšæã£ããã€ãŸããæ¬çš¿ã¯å®å
šãªçŽ 人ãå人çãªã¡ã¢ãšããŠæžããŠãããã®ã ãããããããã°ãšããã®ã¯ãããããã®ãªã¯ãã ãåããã©ããã¯ä¿èšŒã§ããªããå
šè¬çã« yuroyoko ãããæ°å¹Žåã«æžãã iTerm2 + zsh + tmux + vim ã§å¿«é©ãª256è²ã¿ãŒããã«ç°å¢ãæ§ç¯ãã ãåèã«ããã
Vim 以å€ã®è²ã
ãªããš
dotfiles
æ¬çš¿ã§æžããã»ããã¢ãã㯠eed3si9n/dotfiles ã«äžããŠãããä»ã®äººã® dotfiles ã fork ããã®ãäœæ³ããããã©ããèªåã®ç°å¢ã«æã¡èŸŒãèšå®ãã¡ãããšç解ãããã£ãã®ã§ãäžããæžãå§ããã
dotfiles ã®åºæ¬çãªèãæ¹ãšããŠã¯ãããã ~/dotfiles/
ã«ãŸã checkout ããŠãããã«ã¯ zshrc
ãªã©ã®ãã¡ã€ã«ãå
¥ã£ãŠãããããã®ã«ãŒãã®èšå®ãã¡ã€ã«ã¯ããŒã ãã£ã¬ã¯ããªå
㧠~/.zshrc
ãªã©ãšããæãã§ã·ã³ããªãã¯ãªã³ã¯ã匵ãããã
Terminal.app
Mac 㧠iTerm2 ãã©ãããŠãå¿
èŠã«ãªã£ãããšã¯ãŸã ãªãã以åã«ã¯ Terminal.app ã«è²ã
ãšå¶éããã£ãã®ãããããªããã©ãä»ã®æåã¯ããã§éã«åã£ãŠããã
Terminal.app ã䜿ãç¶ããŠããçç±ã®ããäžã€ããåã TotalTerminal ã®ãã¡ã³ã§ããããšã ã
homebrew
Homebrew ã«ã¯ãäžè©±ã«ãªã£ãŠããã
Zsh
ãã®ãã·ã³ã®ã·ã§ã«ã¯ Zsh ã«ãããMac ãªã How to use Homebrew Zsh Instead of Max OS X Default ãåç
§:
2014-05-11
/ scala
çŸå®åé¡ãšããŠæ£èŠè¡šçŸãå¿
èŠã«ãªãããšããããããã€ãã®ããã¹ããã¡ã€ã«ã«å€æããããããã床㫠find
ã³ãã³ããzsh ã®ããã¥ã¡ã³ãã Perl é¢é£ã® StackOverflow ã®è³ªåãææ¢ãããªããäœæ¥ããããšã«ãªããèŠåŽããªãã Perl ãæžããã㯠Scala ã䜿ããããçµå±ãåå人ã®æ
£ãã®åé¡ã ã
äŸãã°ãä»æå
ã« 100以äžã® reStructuredText ãã¡ã€ã«ããã£ãŠãããã markdown ã«å€æããå¿
èŠãããããŸã㯠pandoc ãè©ŠããŠã¿ãŠãããã¯ãããªãã«ããŸããã£ããã ãã©ãäžèº«ãããèªãã§ã¿ããšã³ãŒããªãã©ã«ã®å€ããã¡ãããšãã©ãŒããããããŠãªãããšã«æ°ã¥ãããããã¯åäžã®ããã¯ã¯ã©ãŒã (backtick) ã§å²ãŸããŠããããInterpreted Text ã䜿ã£ãŠããããã¿ããã ããã®ããã¹ããããã€ãã®æ£èŠè¡šçŸã§ååŠçããŠããã°ããŸããšæãã
ã³ãã³ãã©ã€ã³ scalas
åã®çŸåšã®éçºãã·ã³ã«ã¯ scala
ãžã®ãã¹ãéã£ãŠããªããzip ãã¡ã€ã«ãäžåããŠã³ããŒãããã®ã¯å€§ããäœæ¥ãããªããã©ããå°æ¥çã« jar ãšã¹ã¯ãªããã®ç®¡çãããªãããããªãã®ãé¢åãªæ°ããããæ®éãªãå㯠sbt ã䜿ã£ãŠ Scala ã® jar ãããŠã³ããŒãããããããã§ããããã©ããåäžã®ãã¡ã€ã«ã®ã¿ã䜿ã£ã解æ³ã欲ãããšããã
ããã§ä»è©ŠããŠãã®ã sbt ã® script runner ã :
#!/ usr/ bin/ env sbt - Dsbt . version= 1.4 . 7 - Dsbt . main. class= sbt. ScriptMain - Dsbt . supershell= false - error
/***
ThisBuild / scalaVersion := "2.13.4"
*/
println( "hello" )
Read MoreâŠ
2014-03-29
/ scala / sbt
Preview of upcoming sbt 1.0 features: Read about the new plugins ãèš³ããŸããã
è @eed3s9n, @jsuereth
sbt ã«å€åã蚪ããããšããŠãããsbt 1.0 ãžåã㊠sbt ã®åçã§ããèªåå (automation)ãã€ã³ã¿ã©ã¯ã·ã§ã³ (interaction)ãçµ±åå (integration) ã®å
šé¢ã«ãããŠæ¹åãã¿ãããäºå®ã ã1.0 ã®äºå€§æ©èœãšç®ãããŠããã®ã¯ auto plugin ãšããã«ããµãŒããšããŠã® sbtãã® 2ã€ã ã
ä»åŸã®æ°ã¶æã«ããã£ãŠ sbt ããŒã 㯠sbt 0.13 ã³ãŒãããŒã¹äžã«ãããã®æ©èœãè¿œå ããããªãã¥ãŒçããªãªãŒã¹ããããããã®ããªãã¥ãŒçã«ãã£ãŠãsbt 1.0 ã®ä»æ§ãåºãŸãåã«ã³ãã¥ããã£ãŒããã®ãã£ãŒãããã¯ãåŸãããæ°ããèšèšæ¹éãç念ãããŠæ°æ©èœãä¿é²ããããšãç®çãšããŠããã
é·ãé sbt ãæ¯ããŠãã Mark Harrah ããã«ã以å€ã®ããšãããããã«æ
ç«ã£ãŠãã£ãããšãæ®å¿µãªããå ±åããªããã°ãªããªããããããTypesafe ã®ãã«ãããŒã«ããŒã ã§ãã Antonio CuneiãJosh Suereth ã«æ°ããªã¡ã³ã㌠Eugene Yokota (@eed3si9n ) ã sbt ã® techlonogy lead ã®äžäººãšããŠåå ããããšãæè¿ãããã
æ¬çš¿ã§ã¯ãä»åã§ãããã£ã auto plugin æ©èœã玹ä»ããããã㯠sbt 0.13.5-M2 ãªãªãŒã¹ã«å«ãŸããã
2013-12-22
/ scala
æšæ¥ã¯ãäœæ
ãæ©æã«ç®ãèŠã㊠@xuwei_k æ°ã®Scalaã§æœè±¡ã¡ãœãããoverrideããéã«override修食åãä»ããã¹ããã©ããã®æ¯é ãæµãèªã¿ããŠããããã®è©±é¡ã¯é¢çœãããã®ã§ãé£ã³èµ·ããŠããã«è±èš³ ããŠããŸã£ããScalaz ã§ééããã³ãŒããäŸã«ããŠåã¯ã©ã¹ã®ããã©ã«ãã€ã³ã¹ã¿ã³ã¹ãæäŸããããšã®åŸ®åŠãªãžã¬ã³ãã解説ããŠããã
以äžã«åé¡ãç°¡ç¥åããã³ãŒãäŸã瀺ã:
trait Functor {
def map: String
}
trait Traverse extends Functor {
override def map: String = "meh"
}
sealed trait OneOrFunctor extends Functor {
override def map: String = "better"
}
sealed trait OneOrTraverse extends OneOrFunctor with Traverse {
}
object OneOr {
def OneOrFunctor : Functor = new OneOrFunctor {}
def OneOrTraverse : Traverse = new OneOrTraverse {}
}
Read MoreâŠ
2013-12-01
/ sbt
æ¬çš¿ã§ã¯ sbt 0.13 ã«ãããå®è¡æå³è« (execution semantics) ãšã¿ã¹ã¯ã®é次å (task sequencing) ã«ã€ããŠã¿ãŠããããšæãããŸãã¯åæãšãªãèæ¯ã倧ãŸãã«åŸ©ç¿ããŠã次ã«é次çã¿ã¹ã¯ (sequential task) ãè¿œå ããããã«æžããå®éšçãã©ã°ã€ã³ sbt-sequential
ã玹ä»ãããã
èæ¯
Mark æ°ã:
sbt ã®ã¢ãã«ã¯å¯äœçšãã¿ã¹ã¯ã«å±æåãããããšã§ãäŸåæ§ããæºããã°ãã¿ã¹ã¯ã¯ãã€ã§ãå®è¡ã§ãããšãããã®ã ããã®å©ç¹ã¯ããã©ã«ãã§äžŠåã§ããããšã§ãå®éã«ããéããã«ããå¯èœãšããããšã ã
èšãæ¿ãããšãsbt ã䜿ã£ããã«ãå®çŸ©ã¯ã¿ã¹ã¯éã®äŸåæ§ã®ã¿ãå®çŸ©ããŠããŠããããã®ã¿ã¹ã¯ãã©ã®ã¿ã€ãã³ã°ã§å§åãããã㯠sbt ã«ãã£ãŠèªåçã«èšç®ãããããããã¡ãããšç解ããããã«ããŸãå¯äœçšãæã£ã Scala ã³ãŒãã®å®è¡æå³è«ãã¿ãŠã¿ããã
çŽåå®è¡ (serial execution)
class Test {
def startServer() : Unit = {
println( "starting..." )
Thread . sleep( 500 )
}
def stopServer() : Unit = {
println( "stopping..." )
Thread . sleep( 500 )
}
def numberTask: Int = 1
def integrationTest0() : Int = {
val n = numberTask
startServer()
println( "testing..." )
Thread . sleep( 1000 )
stopServer()
n
}
}
Read MoreâŠ
2013-11-20
/ scala
äžèŠæ®éã®æŒç®ã§ãããã«é«éåã§ãããããã€ãèããŠçºè¡šããŠãå¥æ EirÃkr Ã
sheim (@d6 ) ããã® “How to use Spire’s Ops macros in your own project” ã翻蚳ããŸããããã€ãæ°ããã«è©±ããããŠããããã¬ã³ããªãŒã§ãããã€ã§ãã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã
2013幎10æ13æ¥ EirÃkr Ã
sheim è
2013幎11æ20æ¥ e.e d3si9n èš³
Spire ã® Ops ãã¯ããšã¯äœã?
Spire ã®åã¯ã©ã¹ã¯ +
ã *
ãšãã£ãåºç€çãªæŒç®åãæœè±¡åãããæ®éãããã®æŒç®ã¯éåžžã«éãããã®ãããã¡ãã£ãšã§ãäœèšãªäº
(äŸãã°ãboxing ããªããžã§ã¯ãã®å²ãåœãŠãªã©) ãæŒç®ããšã«ãã£ãŠããŸããšããžã§ããªãã¯åããã³ãŒãã¯çŽæ¥åŒã³åºãããã®ãšæ¯ã¹ãŠé
ããã®ã«ãªã£ãŠããŸãã
å¹ççãã€ãžã§ããªãã¯ãªæ°å€ããã°ã©ãã³ã°ã Spire ã®ååšæ矩ã ãäžå¿
èŠãªãªããžã§ã¯ãå²ãåœãŠãåé¿ããããã«åãã¡ã¯ããã€ãã® Ops ãã¯ããçšæãããæ¬çš¿ã§ã¯ãã®ä»çµã¿ãšãåã®ã³ãŒããããããã®ãã¯ãã䜿ãæ¹æ³ã解説ããã
éåžžã®åã¯ã©ã¹ãçšããæé»ã®æŒç®åã®ä»çµã¿
Scala ã§åã¯ã©ã¹ãçšããå Žåãéåžžã¯æé»ã®å€æã«é Œãããšã§ãžã§ããªãã¯ãªåã«æŒç®åããè¿œå ãããã(蚳泚: ãããã Enrich my library ãã¿ãŒã³ã )
以äžã«å
·äœäŸã§èª¬æãããšãA
ã¯ãžã§ããªãã¯ãªåãOrdering
ã¯åã¯ã©ã¹ã§ã>
ãæé»ã®æŒç®åãšãªããfoo1
ã¯ããã°ã©ããæžãã³ãŒãã§ãfoo4
㯠implicit ã解決ãããŠãç³è¡£æ§æãå±éãããåŸã®ãã®ã ã
import scala.math.Ordering
import Ordering.Implicits._
def foo1[ A: Ordering ]( x: A , y: A ) : A =
x > y
def foo2[ A ]( x: A , y: A )( implicit ev: Ordering [ A ]) : A =
x > y
def foo3[ A ]( x: A , y: A )( implicit ev: Ordering [ A ]) : A =
infixOrderingOps[ A ]( x)( ev) > y
def foo4[ A ]( x: A , y: A )( implicit ev: Ordering [ A ]) : A =
new ev. Ops ( x) > y
Read MoreâŠ
2013-10-07
/ sbt
èŠå: ãã® sbt ã«ã€ããŠã®èŠãæžãã¯äžçŽãŠãŒã¶åãã ã
ã»ããã£ã³ã°ã·ã¹ãã
sbt 0.12 åæ§ã« sbt 0.13 ã®äžå¿ã«ããã®ã¯ã»ããã£ã³ã°ã·ã¹ãã ã ãSettings.scala ãèŠãŠã¿ãã:
trait Init [ Scope ] {
...
final case class ScopedKey [ T ](
scope: Scope ,
key: AttributeKey [ T ]) extends KeyedInitialize [ T ] {
...
}
sealed trait Initialize [ T ] {
def dependencies: Seq [ ScopedKey [ _ ]]
def evaluate( map: Settings [ Scope ]) : T
...
}
sealed class Setting [ T ] private [ Init ](
val key: ScopedKey [ T ],
val init: Initialize [ T ],
val pos: SourcePosition ) extends SettingsDefinition {
...
}
}
Read MoreâŠ
2013-09-18
oop ã¯ã©ãå®çŸ©ãããã¹ãã ããã?
çŽç²ãªããžã§ã¯ãæåããã°ã©ãã³ã°
çŽç²ãªããžã§ã¯ãæåããã°ã©ãã³ã°ã¯ä»¥äžã®ããã«å®çŸ©ã§ãã:
ãªããžã§ã¯ãã䜿ã£ãããã°ã©ãã³ã°ã
ãªããžã§ã¯ããšã¯äœã?
ä»ã®ãªããžã§ã¯ããžã®åç
§ãä¿æããäºåã«ãªã¹ãã¢ãããããã¡ãã»ãŒãžãåä¿¡ããããšãã§ããä»ã®ãªããžã§ã¯ããèªåèªèº«ã«ã¡ãã»ãŒãžãéä¿¡ããããšãã§ããã¢ãã ã§ãä»ã«ã¯äœãããªããã¡ãã»ãŒãžã¯ååãšãªããžã§ã¯ããžã®åç
§ã®ãªã¹ãããæ§æãããã
ããã§ãããŸããèšãåãã¯åãèãããã®ã ãã©ãã¢ã€ãã£ã¢ã¯ãªããžã§ã¯ãæåãšããèšèãäœã£ã匵æ¬äºº Alan Kay (2003) ããã®ãã®ã ããã以å€ã¯ãçŽæ¥ oop ã«é¢ä¿ç¡ãããå®è£
äžã®è©³çŽ°ã ã
2013-07-24
/ sbt
æŠèŠ
äºææ§ã«åœ±é¿ã®ããæ°æ©èœãå€æŽç¹ããã°ä¿®æ£
sbt ãšãã«ãå®çŸ©ã Scala 2.10 ã«ç§»è¡ããã
project/plugins/
å
ã«çœ®ããããã©ã°ã€ã³ã®èšå®ãã¡ã€ã«ã®ãµããŒããå»æ¢ããããã㯠0.11.2 ããå»æ¢äºå®ã«ãªã£ãŠããã
set
ã³ãã³ãã«ãããŠã»ããã£ã³ã°ã®å³èŸºé
å
ã®ã¿ãè£å®ãå»æ¢ãããæ°ãã«è¿œå ãããã¿ã¹ã¯ãã¯ãããã®ã¿ãè£å®ãäžèŠã«ããããã ã
ããŒã®æ
£çšçãªæžãæ¹ã¯ãããããã£ã¡ã«ã±ãŒã¹ camelCase ã®ã¿ãšããã詳现ã¯åŸã»ã©ã
Maven ãšã®äºææ§ãæ£ãããããã¹ãã®ããã©ã«ãã® classifier ã tests
ã«ä¿®æ£ããã
ã°ããŒãã«ãªã»ããã£ã³ã°ãšãã©ã°ã€ã³ã®ãã£ã¬ã¯ããªãããŒãžã§ã³ä»ããããã«ãããããã©ã«ãã§ã¯ãã°ããŒãã«ã»ããã£ã³ã°ã¯ ~/.sbt/0.13/
ã«ãã°ããŒãã«ãã©ã°ã€ã³ã¯ ~/.sbt/0.13/plugins/
ã«çœ®ããããsbt.global.base
ã·ã¹ãã ããããã£ã䜿ã£ãæ瀺çãªãªãŒããŒã©ã€ãã¯ç¶ç¶ããŠé©çšãããã(#735 )
scalac ã«ãã¡ã€ã«ãæž¡ããšãã« sbt ãè¡ãªã£ãŠããæ£èŠå (canonicalization) ãå»æ¢ããã(#723 )
åãããžã§ã¯ããããããåºæã® target
ãã£ã¬ã¯ããªãæã€ããšã匷å¶ããããã«ããã
äŸåã©ã€ãã©ãªã® Scala ããŒãžã§ã³ããªãŒããŒã©ã€ãããªãããã«ãããããã«ãã£ãŠåå¥ã®èšå®ãç°ãªã Scala ããŒãžã§ã³ã«äŸåã§ããããã«ãªããscala-library
以å€ã® Scala äŸåæ§ãéåžžã®ã©ã€ãã©ãªäŸåæ§ãšåãããã«æ±ããããã«ãªã£ããããããããã«ãã£ãŠãã®ä»ã® scala-library
以å€ã® Scala ã©ã€ãã©ãªãæçµçã« scalaVersion
以å€ã®ããŒãžã§ã³ã«è§£æ±ºãããå¯èœæ§ãçãŸããã
Cygwin ã§ã® JLine ã®èšå®ãå€æŽããããSetup åç
§ã
Windows äžã§ã® JLine ãš Ansi ã³ãŒãã®æ¯ãèããæ¹åããããCI ãµãŒãå
ã§ã¯ -Dsbt.log.format=false
ãæå®ããŠæ瀺çã« Ansi ã³ãŒããç¡å¹ã«ããå¿
èŠããããããããªãã
ãã©ãŒã¯ããããã¹ãã run ããããžã§ã¯ãã®ããŒã¹ãã£ã¬ã¯ããªãã«ã¬ã³ãã»ã¯ãŒãã³ã°ã»ãã£ã¬ã¯ããªãšããŠçšããããã«ããã
compileInputs
㯠Compile
ã§ã¯ãªã (Compile,compile)
å
ã§å®çŸ©ããããã«ããã
ãã¹ãã®å®è¡çµæ㯠Tests.Output
ã«ãªã£ãã
æ°æ©èœ
boot.properties
å
ã®ã¬ããžããªãããã©ã«ãã®ãããžã§ã¯ãã® resolver ãšããŠçšãããboot.properties
å
ã®ã¬ããžããªã« bootOnly
ãšæžãããšã§ããã©ã«ãã§ãããžã§ã¯ãã«äœ¿çšãããªãããã«ããããšãã§ããã (Josh S., #608 )
.sbt ãã¡ã€ã«å
㧠val
ã def
ãæžããããã«ããã詳现ã¯åŸã»ã©ã
.sbt ãã¡ã€ã«å
ã§ãããžã§ã¯ããå®çŸ©ã§ããããã«ãããProject
åã® val
ããã«ãã«è¿œå ããããšã«ãªãã詳现ã¯åŸã»ã©ã
ã»ããã£ã³ã°ãã¿ã¹ã¯ãããã³ã€ã³ãããã»ã¿ã¹ã¯ã®æ°æ§æã詳现ã¯åŸã»ã©ã
autoAPIMappings := true
ãšããããšã§ãäŸåã©ã€ãã©ãªã®å€éš API scaladoc ã«èªåçã«ãªã³ã¯ããããã«ããããã㯠Scala 2.10.1 ãå¿
èŠãšããapiURL
ã䜿ã£ãŠäŸåã©ã€ãã©ãªã® scaladoc ã®å Žæãæå®ããå¿
èŠããããapiMappings
ã¿ã¹ã¯ã䜿ã£ãŠæåã§ãããã³ã°ãæäŸããããšãã§ããã
ã¹ã€ããã³ãã³ãã䜿ã£ãŠäžæçã« Scala ããŒã ãã£ã¬ã¯ããªãèšå®ã§ããããã«ãã: ++ scala-version=/path/to/scala/home
ã ã ãããscala-version
ã®éšåã¯çç¥å¯èœã ãããããŒãžäŸåæ§ã®è§£æ±ºã«çšããããã
~/.m2/repository
ã«å
¬éããããã® publishM2
ã³ãã³ããè¿œå ããã(#485 )
ã«ãŒããããžã§ã¯ããå®çŸ©ãããŠããªãå Žåã¯ãå
šãŠã®ãããžã§ã¯ããéçŽããããã©ã«ãã®ã«ãŒããããžã§ã¯ããçšããã(#697 )
è€æ°ã®ãããžã§ã¯ããã³ã³ãã£ã®ã¥ã¬ãŒã·ã§ã³ããã¿ã¹ã¯ãã»ããã£ã³ã°ãååŸããããã®æ°ãã API ãè¿œå ãããGetting values from multiple scopes åç
§ã
ãã¹ããã¬ãŒã ã¯ãŒã¯ã®æ©èœãããè¯ããµããŒãããããã«ãã¹ãã€ã³ã¿ãŒãã§ã€ã¹ãæ¹åãããïŒè©³çŽ°ã¯ïŒ
export
ã³ãã³ã
ã¿ã¹ã¯ã®å Žåã¯ãexport ã¹ããªãŒã ã®å
容ã衚瀺ãããæ
£äŸãšããŠã¯ãã¿ã¹ã¯ãšç䟡ã®ã³ãã³ãã©ã€ã³ã衚瀺ãããäŸãã°ãcompile
ãdoc
ãconsole
ã¯ããããå®è¡ããè¿äŒŒçãªã³ãã³ãã©ã€ã³ã衚瀺ããã
ã»ããã£ã³ã°ã®å Žåã¯ããã¬ãŒãçµç±ããã«ã»ããã£ã³ã°ã®å€ãçŽæ¥è¡šç€ºããã
ãã°ä¿®æ£
äŸåã©ã€ãã©ãªã®è¡çªãèŠåããªãããã«ããã代ããã« conflict manager ãèšå®ããã(#709 )
ãã©ãŒã¯ããããã¹ããå®è¡ãããšãã« Cleanup ãš Setup ãå®è¡ããããã«ãããå¥ã® JVM ã§å®è¡ããããããã¯ã©ã¹ããŒãã¯äœ¿ãããšãã§ããªãã
æ¹åç¹
API æœåºãã§ãŒãºããtyper
ãã§ãŒãºã§ã¯ãªã picker
ãã§ãŒãºã®åŸã§å®è¡ããããšã§ typer ã®åŸã«ã³ã³ãã€ã©ãã©ã°ã€ã³ã眮ããããã«ããã(Adriaan M., #609 )
ã»ããã£ã³ã°ã®ãœãŒã¹å
ã«ãããäœçœ®ãèšé²ããããã«ãããinspect
ã¯å®çŸ©ãããå€ã«é¢ããå
šãŠã®ã»ããã£ã³ã°ã®äœçœ®ã衚瀺ããã
Build.rootProject
å
ã«ã«ãŒããããžã§ã¯ããæ瀺çã«æå®ã§ããããã«ããã
ãã£ãã·ã¥æ
å ±ãä¿åããããã®ãã£ã¬ã¯ããªãå¿
èŠãªã¿ã¹ã¯ã¯ stream
ã® cacheDirectory
ã䜿ããããã«ãªã£ãããã㯠cacheDirectory
ã»ããã£ã³ã°ã«åã£ãŠä»£ããã
ãã©ãŒã¯ããã run
ã test
ã«ãã£ãŠäœ¿ãããç°å¢å€æ°ã envVars
ã«ãã£ãŠèšå®ã§ããããã«ãªã£ãããã㯠Task[Map[String,String]]
ã ã(#665 )
ã³ã³ãã€ã«ã«å€±æããå Žåã«ã¯ã©ã¹ãã¡ã€ã«ã埩æ§ããããã«ãããããã¯ãšã©ãŒãã€ã³ã¯ãªã¡ã³ã¿ã«ã³ã³ãã¬ãŒã·ã§ã³ã®åŸãã®æ¹ã®éçšã§çºçããŠãããä¿®æ£ããã«ã¯å
ã®å€æŽããããã¡ã€ã«ãçŽãå¿
èŠãããå Žåã«åœ¹ã«ç«ã€ã
ããã©ã«ããããžã§ã¯ãã®èªåçæID ãæ¹åããã(#554 )
scala ã³ãã³ãã«ããäœèšãªã¯ã©ã¹ããŒããåé¿ããããã«ãã©ãŒã¯ããã run
㯠java ã³ãã³ãã䜿ãããã«ããã(#702 )
autoCompilerPlugins
ãå
éšäŸåãããžã§ã¯ãå
ã§å®çŸ©ãããã³ã³ãã€ã©ãã©ã°ã€ã³ã䜿ããããã«ããããã ãããã©ã°ã€ã³ã®ãããžã§ã¯ã㯠exportJars := true
ãå®çŸ©ããå¿
èŠãããããã©ã°ã€ã³ã«äŸåããã«ã¯ ...dependsOn(... % Configurations.CompilerPlugin)
ãšæžãã
éãã©ã€ããŒããªãã³ãã¬ãŒãã®èŠªã¯ã©ã¹ã远跡ããããšã§ãã€ã³ã¯ãªã¡ã³ã¿ã«ã³ã³ãã¬ãŒã·ã§ã³æã«ããå°ãªãå°ããäžéã¹ããããå¿
èŠãšããããã«ããã
ã€ã³ã¯ãªã¡ã³ã¿ã«ã³ã³ãã€ã©ã«ãã£ãŠæœåºããã API ã®å
éšæ§é ããããã°ããããã®ãŠãŒãã£ãªãã£ãè¿œå ããã(Grzegorz K., #677 , #793 )
consoleProject
ã¯ã»ããã£ã³ã°ã®å€ã®ååŸãšã¿ã¹ã¯ã®å®è¡ãçµ±åããæ§æãæäŸãããConsole Project åç
§ã
ãã®ä»
Eclipse ãŠãŒã¶ã®äŸ¿å®ã®ããã« sbt ãããžã§ã¯ãèªäœã®ãœãŒã¹ã®ã¬ã€ã¢ãŠããããã±ãŒãžåã«æ²¿ã£ããã®ã«å€æŽããã(Grzegorz K., #613 )
倧ããªå€æŽç¹ã®è©³çŽ°
ãã£ã¡ã«ã±ãŒã¹ã®ããŒå
ãããŸã§ã®ããŒåã®æžãæ¹ã¯ãScala ã®èå¥åã¯ãã£ã¡ã«ã±ãŒã¹ã§ãã³ãã³ãã©ã€ã³ã§ã¯ãã€ãã³ã§ã€ãªããå°æåãšããæ
£çšã ã£ãããããããã¯äž¡æ¹ãšããã£ã¡ã«ã±ãŒã¹ã«çµ±äžãããæ¢åã®ãã€ãã³ä»ããããããŒåã«å¯ŸããŠããã£ã¡ã«ã±ãŒã¹ã䜿ãããšãã§ãããŸãæ¢ã«ããã¿ã¹ã¯ãã»ããã£ã³ã°ã«å¯ŸããŠã¯ç¶ç¶ããŠãã€ãã³ä»ãããã圢åŒãåãä»ãããããããã¿ãè£å®ã¯ãã£ã¡ã«ã±ãŒã¹ã®ã¿ã衚瀺ããããã«ãªãã
2013-06-24
2012幎4æ23æ¥ã«ãããµã¹ã® Austin ã§è¡ããã RailsConf 2012 ã§ã® Rich Hickey (@richhickey) ããã«ããåºèª¿è¬æŒãSimplicity Matters ãæžãèµ·ãããŠç¿»èš³ããŸããã
Rich Hickey ãã㯠Clojure ã Datomic ã®äœè
ã§ãã
ãã®ç¿»èš³ã¯ Creative Commons Attribution ShareAlike 3.0 ã©ã€ã»ã³ã¹ã«åºããŠå
¬éããŸãã
Rich Hickey è¬æŒ
e.e d3si9n èš³
2013-06-20
/ scala
JavaScript ãäœãããã®ã¯ 1995幎ã®ããšã ããããJavaScript: The Good Partsã(2008幎)ãjQuery (2006幎)ãV8 (2008幎) ãªã©ãç»å Žãããããããªãåã«äœãããããšã«ãªããjQuery ãš V8 ãå ç®çãªè²¢ç®ã§ããã®ã«å¯ŸããŠãDouglas Crockford æ°ã®ãThe Good Partsããé¢çœãã®ã¯ãèšèªããæ©èœãåŒãç®ããæ¬ã§ããããšã ãšæãã
ããæè¿ããã Scala ããªã¢ã«ã¯ãŒã«ããªå¶çŽã§ãã Java çãªèŠªãã¿ããããäºææ§ãç¡èŠããŠã¯ã³ããŒã©ã³ãçãªèšå®ã§ãµãã»ãããäœã£ããã©ããªãã ããããšèããŠãããScala ã Java ã®ä»£æ¿ãšããŠäœ¿ãäºãèš±ããããªããé¢æ°åããã°ã©ãã³ã°èšèªã®ä»£æ¿ãšããŠäœ¿ã£ãŠããããããªãããšæãããã®æèå®éšã®ããäžã€ã®è©Šã¿ã¯ãScala ã®æ§æã®äžã§éè€ããŠãããã®ãæžããããšã ãæ¬çš¿ã§ã¯ãæ
£çšçãªçšæ³ãäœããèããããäœãã«å¯ŸããŠè¯ãæªãã®å€å®ãäžãããšã«ã¯èå³ã¯ç¡ããããã¯ç©ºé£ã¶ãµã³ãã€ããã®ããŒã (The Flying Sandwich Parts; TFSP) ãšåŒã¶ããšã«ããã
å€
What talk you of the posy or the value?
â William Shakespeare, Merchant of Venice
Scala èšèªä»æ§ã¯å€ã以äžã®ããã«å®çŸ©ãã:
å€å®çŸ© val x : T = e
ã¯ãe
ã®è©äŸ¡ããåŸãããå€ã®ååãšã㊠x
ãå®çŸ©ããŸãã
TFSP ã«ãããŠã¯ããã¬ã€ããã¯ã©ã¹ã®æ¬æå
ã§ã¯å泚é T
ã®çç¥ãçŠæ¢ãããé¢æ°å
ã®ããŒã«ã«ã®å€ã¯åæšè«ã䜿ã£ãŠå®çŸ©ããŠããããããã«ãã£ãŠé¢æ°ã¬ãã«ã«ãããŠåæ€æ»ãè¡ãããããšãä¿èšŒãããã
2013-06-09
/ scala
scopt is a little command line options parsing library.
ä»æ¥ scopt 3.0 ããªãªãŒã¹ãããå®è£
ã®è©³çŽ°ã«èå³ãç¡ããã°ãreadme ã«é£ãã§ã»ããã
2010幎3æ4æ¥ããå㯠scopt ã®ã³ããã¿ã«ãªã£ããããã¯å
ã
Aaron Harnly ããã 2008幎ããæžãã scala-options ã®ãã©ãŒã¯ã ã確ããusage text åšãã®å€æŽãš key=value options ãš argument list ãšããæ©èœãè¿œå ãããã£ããã ãšæãããã以éå
šãŠã®ãã°ã¬ããæ
åœããŠããããã®äžã«ã¯ jar ã scala-tools.org ã«å
¬éããŠãããšããã®ããã£ãã2012幎3æ18æ¥ãåã¯åã³ãããžã§ã¯ãã scopt/scopt ã«ãã©ãŒã¯ã㊠immutable parser ãè¿œå ãã scopt 2.0.0 ããªãªãŒã¹ããã
æ°å¹Žã«æž¡ã£ãŠéããããã«ããŠæ©èœãè¿œå ããããããscopt3 ã¯äžããæžãçŽãããšã«ãããçºç«¯ãšãªã£ãã®ã¯ Leif Wickland ããã«ãscopt ã« intArg() ãç¡ãã®ã¯èšèšäžã®çç±ãããã®ãã ãšèãããããšã ã
Ruby ã® OptionParser ã« inspire ãããŠæžãããå
ã® Aaron ããã® scala-options ã«ã¯ãªãã·ã§ã³ã®ããã« 5åã®ã¡ãœããããã£ã: onInt
ã onDouble
ã onBoolean
ã on
ãããããããäžã€ãªãŒããŒããŒãããã on
ãéãªãéçºã®çµæ scopt2 㯠opt
ã®ãªãŒããŒããŒãã 6ã€ãintOpt
ã doubleOpt
ã booleanOpt
ã keyValueOpt
ã keyIntValueOpt
ã keyDoubleValueOpt
ã keyBooleanValueOpt
ããããã« 4ã€ã¥ã€ã®ãªãŒããŒããŒããèç©ããããåèš 34 ãã®ã¡ãœããã ! ãããã®ãªãŒããŒããŒãã¯çç¥å¯èœãªé æåãå€ã®ååã®ããã«åãè¿œå ãããã®ã ãããèªå以å€ã«è²¬ããããç¡ãããã以äžã®æ¡åŒµã¯èããããªãã£ãã
2013-05-11
/ scala
Dispatch 㯠Scala ããããããžã€ãªãããã¡ã¯ãã®æ¹æ³ã§ããç¶ããŠãããæšä»ã®ãã³ããããã³ã°IO ãžã®æµããšæ©èª¿ãåãã㊠@n8han ã¯ã©ã€ãã©ãªã Async Http Client ããŒã¹ã®ãã®ã«æžããªãããReboot ãšåŒãã ãåŸã«ããã¯ãDispatch 0.9 ãšããŠãªãªãŒã¹ããããããã«ãç¬èªã® Promise
ã SIP-14 ã§æšæºåããã Future
ã«çœ®ãæãããã®ã Dispatch 0.10 ã ã
Dispatch Classic åæ§ã« Reboot ã§ã web API ãã©ããã³ã°ãããã©ã°ã€ã³ãäœãããšãã§ãããæ¬çš¿ã§ã¯ãClassic ã§æžããããã©ã°ã€ã³ã移æ€ããªãã Dispatch 0.10 ãã©ã°ã€ã³ã®æžãæ¹ã解説ããŠããã
ä»ã®ãã©ã°ã€ã³ãšã®ååã®è¡çªãåé¿ããããã«ãåã®ã¯ dispatch-twitter ã§ã¯ãªã repatch-twitter ãšåŒã¶ããšã«ããã
sbt
ãŸã㯠sbt ã®èšå®ããå§ãã:
repatch-twitter/
+- project/
| +- build.properties
| +- build.scala
+- core/
+- src/
+- main/
+- scala/
+- requests.scala
+- ...
Read MoreâŠ
2013-04-02
/ scala / conference
ããäžã¶æçµã€ãã© 2013幎3æ1æ¥ã«æ¥æ¬ã«äžæåž°åœããŠãScala Conference in Japan 2013ãã«åºåžãããããããååã®ã«ã³ãã¡ã¬ã³ã¹ã
ããããã£ã¹ããã
ããæ¥ (2012幎6æ2æ¥ã ãã©) Scala Days 2012 ã§é²é³ããã Scala Types ãèããŠãããšèª°ãã (@timperrett ãã) “I would love to see Scala Days in Asia. We had two in Europe now. It would be wicked to have it in China or Japan, or somewhere like that.” ãšèšã£ãŠããã®ã§ããã®è¶£æšã Twitter ã§äŒãã :
ä» Scala Days 2012 ã§é²é³ããã Scala Types ãèŽããŠãããéå¬å°ã欧米åã«åã£ãŠããã次ãããæ¥æ¬ãšãã¢ãžã¢åãªããŠã©ãã ããã£ãŠè©±ãåºãŠããã³ãã¥ããã£ã声åºãã°èªèŽããããããã
äŒè©±ãå§ãŸããš @jsuereth ãããã«æ¯æã®å£°ãäžããŠããã:
2012-12-12
/ scalaz
ãã㯠Scalaz Advent Calendar 2012 12æ¥ç®ã®èšäºã§ãã
次ã
ãš Scala çã®ç¥èœæŽŸãéçµãããŠãã Precog 瀟ã®éçºããŒã ããã®ããã° Precog.Copointed ãä»æ¥ã¯ blueeyes ãªã©ã®éçºã§ãç¥ããã Kris Nuttycombe (@nuttycom ) ãããæžãã The Abstract Future ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã
2012幎11æ27æ¥ Kris Nuttycombe è
2012幎12æ11æ¥ e.e d3si9n èš³
Precog éçºããã°ã®åå ã¯åãã¡ã Cake ãã¿ãŒã³ã䜿ã£ãŠã³ãŒãããŒã¹ãæ§é åããŠãã®ãªã®ãªãŸã§å®è£
åãæœè±¡åããŠããŠããããšã Daniel ãæžããããã®èšäºã§ã®èª¬æã®ãšãããããã¯éåžžã«åŒ·åãªæŠå¿µã ãåãååšåãšããŠä¿ã€ããšã§ããããŠéžæãããåããæèãããŠããªãã¢ãžã¥ãŒã«ããã¯ãããã®åã®å€ã¯äžå¯èŠã§ãããããã«ãã»ã«åã®å¢çã®çªç Žãã³ã³ãã€ã©ãé²æ¢ããŠãããã
ä»æ¥ã®èšäºã§ã¯ããã®æŠå¿µãåããããã«é²ããŠåã³ã³ã¹ãã©ã¯ã¿ã«é©çšããŠãèšç®ã¢ãã«ãäžžããšçœ®ãæããæ©æ§ãšããŠäœ¿ããããšã説æããã
Scala ãå°ãã§ã䜿ã£ãããšãããã°ãäœããã®æèã§èª°ãããã¢ããããšããèšèã䜿ã£ãã®ãèããããšãããã ãããäŸãã°ãScala ã® for
ãšããããŒã¯ãŒãã«ããæäŸãããç³è¡£æ§æã«é¢ããè°è«ããOption
åã䜿ãããšã§ null åç
§ãšã©ãŒã®èœãšãç©Žãåé¿ã§ãã ããšã説æããããã°èšäºã§èªãã ã®ãããããªããScala ã§ã®ã¢ããã«é¢ããè°è«ã®å€§åããã³ã³ãããåã«çŠç¹ãåœãŠãŠããã®ã«å¯ŸããŠãScala ãšã³ã·ã¹ãã ã§ããèŠãããããã€ãã®åã®äžã«ã¢ããã£ãã¯åæã®ããé¢çœãåŽé¢ãè¡šãããã®ããããéå®èšç® (delimited computation) ã ãã©ã®ã¢ããã£ãã¯ãªåãåæããŠããã®åŽé¢ãèŠãããšãã§ãããããããçŽæ¥å©çšããäŸãšããŠæããã䜿ãããŠãã Scala ã§ã®ã¢ããã£ãã¯ãªåã«éåæèšç®ããšã³ã³ãŒããã akka.dispatch.Future
ããã (ãã㯠Scala 2.10 ã«ãããŠçŸè¡ã® Future ã眮ãæããäºå®ã®ãã®ã )ãããã¯èšç®ã®ã¹ããããé åºä»ãããããã®æè»ãªæ¹æ³ãæäŸããããšã§ãæ¬çš¿ã泚ç®ããã¢ããã£ãã¯åæã®äžé¢ãäœçŸããã
2012-12-05
/ scalaz
ãã㯠Scalaz Advent Calendar 2012 5æ¥ç®ã®èšäºã§ãã
12æã®éäžãæ¥æ¬ã®æè¡ç³»ã®ãŒã¯ã¯æ¥æ¿ããã§ããŒãã«æ²¿ã£ãèšäºãå
¬éãã圌ã®åœã§ã¯ãAdvent CalendarããšåŒã°ããŠããããããå»å¹Žã® Scala Advent Calendar 2011 ã§å㯠Eric Torreborre ããã The Essence of Iterator Pattern ãã«ããŒããèšäºã翻蚳 ãããããã¯æ¥æ¬äººã®é¢æ°åããã°ã©ãã³ã°èšäºå¥œããç¥ã£ãäžã§ããçšåºŠçã£ããã®ã ã£ãããã1ã€ã®å©å·±çãªåæ©ã¯ãèšäºãäžèªäžèªèš³ãéçšã«ãããŠæŠå¿µã®ããã€ãã¯åã®é ã«ãæã¿ããã§ãããããããªãããšããæåŸ
ã ã£ããæ¯ãè¿ã£ãŠã¿ããšãäž¡æ¹ã®ç®çãšãäœæŠæåã ã£ããšèšãããJeremy Gibbons ãããBruno Oliveira ãããã㊠Eric äž¡æ¹ã®ä»äºã®ã¯ãªãªãã£ã®ãé°ã ããããã®æã¿èŸŒãã ç¥èãä»å¹Žã«æžããç¬ç¿ Scalaz ã·ãªãŒãºã®é ãå³ã ã£ãããããªãããšæã£ãŠããã
ç¬ç¿ Scalaz 12æ¥ç® ã§ãµãããšãããScalaz 7 ã®åã¯ã©ã¹ã€ã³ã¹ã¿ã³ã¹ã«ã¯æ¢ã« product
ãš compose
ãå«ãŸããŠããããŸã Traverse
ãå®çŸ©ãããŠãããè«æã«ãã word count ã®äŸé¡ ãŸã§ãããåãæ°ã¥ããã®ã¯ãå€ã¬ãã«ã§ã®åæãç¡ãããšã ããã®è«æã®èå³æ·±ãç¹ã®1ã€ã«ãapplicative functor ã®åæãããããããã¯ã¢ãžã¥ãŒã«åããã°ã©ãã³ã°çãªãã®ãå¯èœãšããã
Gibbons ãš Oliveira ã®èšããapplicative functorãã¯å®ã¯åã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ã ãã§ã¯ãªããapplicative é¢æ°ã®åæãæããŠãããããã¯è«æããã®ä»¥äžã®æç²ãã¿ãã°æããã :
data (m â n) a = Prod { pfst :: m a, psnd :: n a }
(â ) :: (Functor m, Functor n) â (a â m b) â (a â n b) â (a â (m â n) b)
(f â g) x = Prod (f x)(gx)
Read MoreâŠ
2012-08-21
John Wiegley ããã® “Monads in Pictures” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2012幎8æ20æ¥ John Wiegley è
2012幎8æ21æ¥ e.e d3si9n èš³
ããã¯ã¢ããã®ãã¥ãŒããªã¢ã«ã§ã¯ãªãããããã«ã¯æ°åŠçšèªãåºãŠããªããæ¬çš¿ã¯ãæ¢ã«ã¢ãããäžå¿äœ¿ãããããã«ã¯ç¿ã£ã人ã察象ãšãããèŠèŠåããããšã§ãäœã®ããã«äœããã£ãŠããããæããã«ãªãã¯ãã ã
é¢æ°
ã¢ããã«å¯ŸããçŽæãåŸãäžã€ã®æ¹æ³ãšããŠé¢æ°ããã¢ãããžã®æœè±¡åããã©ããšãããã®ããããé¢æ°ãäœããã£ãŠããã®ããç°¡åãªçµµã§è¡šããŠã¿ãããHaskell ã®é¢æ°ã®åŒã³åºãã®æ§æãäžã«ãåãæŒç®ãèŠèŠåãããã®ãäžã«çœ®ãã:
2012-08-06
Scala ãã¯ãã®äœè
Eugene Burmako ããã«ãããªãã¬ã¯ã·ã§ã³ API ã«é¢ããçºè¡šã®ã¹ã©ã€ãã“Metaprogramming in Scala 2.10” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2012幎4æ28æ¥ Eugene Burmako è
2012幎8æ5æ¥ e.e d3si9n èš³
ã¯ããã«
ã¡ã¿ããã°ã©ãã³ã°
ã¡ã¿ããã°ã©ãã³ã°ãšã¯ãä»ã®ããã°ã©ã ãèªèº«ãããŒã¿ãšããŠæžãããæäœããã³ã³ãã¥ãŒã¿ããã°ã©ã ãæžãããšããâWikipedia
ã³ã³ãã€ã©
å: ã©ããã£ãŠã¡ã¿ããã°ã©ãã³ã°ãå¯èœã«ããããšãã§ãã ãã?
ç: ã³ã³ãã€ã©ãããããã°ã©ã ã«é¢ããŠããŒã¿ãæã€è
ãããã ããã?
ããã°ã©ãã«ã³ã³ãã€ã©ãå
¬éãããã
ãªãã¬ã¯ã·ã§ã³
2.10 ã§ã¯ããã°ã©ã ã«é¢ããããŒã¿ããªãã¬ã¯ã·ã§ã³ API ãšããŠå
¬éããã
ãã® API ã¯ãscala-library.jar (ã€ã³ã¿ãŒãã§ã€ã¹)ãscala-reflect.jar (å®è£
)ãscala-compiler.jar (å®è¡æã³ã³ãã€ã«) ã«ãŸããã£ãŠããã
Martin ã®æ¹ã詳ãã
å
æ¥è¡ããã Martin Odersky å
çã«ããè¬æŒã«ãŠãªãã¬ã¯ã·ã§ã³ API ã®èšèšã詳ãã説æãããŠãã:
å®ç¿
ä»æ¥ã¯ãããã€ãã®å
·äœäŸãéããŠãªãã¬ã¯ã·ã§ã³ API ã®åºç€ãç¿ãããŸãã©ããã£ãŠæŽã«å€ãã®æ
å ±ãåŸãããããç¿ãã
2012-08-01
Scala ãã¯ãã®äœè
Eugene Burmako ããã管çãã scalamacros.org ãã “Getting started” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
Eugene Burmako è
2012幎7æ31æ¥ e.e d3si9n èš³
1. Scala 2.10 ãå
¥æãã
ãã¯ã㯠2.10.0-M3 以éã® Scala ã§åºè·ãããŠãããçŸè¡ã®ãã€ã«ã¹ããŒã³ã§ãã 2.10.0-M6 ãªã©ã®ãã¯ããå
¥ã£ãã³ã³ãã€ã©ãçŽæ¥ããŠã³ããŒã ããããMaven ã sbt ãªã©ããåç
§ããã奜ããªæ¹æ³ã䜿ã£ãŠããã
蚳泚: sbt 0.11.3 ã䜿ã£ããããžã§ã¯ãã github ã«çšæããã®ã§ã
git clone -b ja https://github.com/eed3si9n/scalamacros-getting-started.git
ã§ã»ããã¢ããã§ããã
2. ãã¯ããæžã
Macros.scala
ãšãããã¡ã€ã«ãäœã£ãŠä»¥äžã®ã³ãŒããããŒã¹ããã (é¢é£ãã API ãã€ã³ãã©ãªã©ãã¯ãã·ã¹ãã ã«å€§åãªããšãæžãããŠããã®ã§ã³ã¡ã³ãããã£ããèªãã§ã»ãã)ã
import scala.reflect.makro.Context
import collection.mutable.ListBuffer
import collection.mutable.Stack
object Macros {
// ãã¯ãå®çŸ©ã®ã·ã°ããã£ã¯å¥œããªãã©ã¡ãŒã¿ãåãåãæ®éã®é¢æ°ãšåãã ã
// ããããæ¬æã¯å®è£
ãžã®åç
§ã®ã¿ãšãªãã
def printf( format: String , params: Any* ) : Unit = macro printf_impl
// ãã¯ãå®è£
ã®ã·ã°ããã£ã¯ãã¯ãå®çŸ©ã®ãã®ãšå¯Ÿå¿ããå¿
èŠãããã
// äžèŠè€éã«èŠããããå¿é
ããå¿
èŠã¯ãªãã
// ããã³ã³ãã€ã©ãäžæºãªãããšã©ãŒã¡ãã»ãŒãžã§å¿
èŠãªã·ã°ããã£ãæããŠãããã
def printf_impl( c: Context )( format: c.Expr [ String ],
params: c.Expr [ Any ]*) : c.Expr [ Unit ] = {
// ã³ã³ãã€ã© API 㯠scala.reflect.makro.Context ãéããŠå
¬éãããŠããã
// ãã®æãéèŠãªéšåã§ãããªãã¬ã¯ã·ã§ã³ API ã¯
// c.universe ããã¢ã¯ã»ã¹ããããšãã§ããã
// é »ç¹ã«äœ¿ããããã®ã®å€ããå«ãŸããŠããããã
// import c.universe._ ãã€ã³ããŒãããã®ãæ
£äŸã ã
import c.universe._
// ãŸããæž¡ããã format æååãããŒã¹ããã
// ãã¯ãã¯ã³ã³ãã€ã«æã«åäœãããããå€ã§ã¯ãªãæ§ææšã«äœçšããã
// ãã®ããããã®ãã¯ãã«æž¡ããã format ãã©ã¡ãŒã¿ã¯
// ã³ã³ãã€ã«æã®ãªãã©ã«ã§ããã
// java.lang.String åã®ãªããžã§ã¯ãã§ã¯ãªãã
// ããã¯ãŸãã以äžã®ã³ãŒãã§ã¯ printf("%d" + "%d", ...) ã§ã¯
// åäœããªãããšãæå³ããã
// ãªããªããã®å Žå㯠format ã¯æåãªãã©ã«ã§ã¯ãªã
// 2ã€ã®æåãªãã©ã«ã®é£çµãè¡šã AST ãšãªãããã ã
// ä»»æã®ãã®ã§åäœããããã«ãã®ãã¯ããæ¹è¯ããã®ã¯èªè
ãžã®ç·Žç¿åé¡ãšãããã
val Literal ( Constant ( s_format: String )) = format. tree
// ããããã³ã³ãã€ã©ã«çªå
¥ããã
// ããäžã®ã³ãŒãã§ã¯äžæç㪠val ãäœã£ãŠãã©ãŒããããããåŒãäºåã«èšç®ããã
// åç㪠Scala ã³ãŒãã®çæã«é¢ããŠãã詳ããç¥ãããå Žåã¯ä»¥äžã®ã¹ã©ã€ããåç
§:
// http://eed3si9n.com/ja/metaprogramming-in-scala-210
val evals = ListBuffer [ ValDef ]()
def precompute( value: Tree , tpe: Type ) : Ident = {
val freshName = newTermName( c. fresh( "eval$" ))
evals += ValDef ( Modifiers (), freshName, TypeTree ( tpe), value)
Ident ( freshName)
}
// ããã¯ãããã¡ãª AST ã«å¯Ÿããæäœã§ãç¹ã«é£ããããšã¯è¡ãªã£ãŠããªãã
// ãã¯ãã®ãã©ã¡ãŒã¿ããæ§ææšãæœåºããå解/解æããŠå€æããã
// Int ãš String ã«å¯Ÿå¿ãã Scala åãæã«å
¥ããŠããæ¹æ³ã«æ³šæããŠã»ããã
// ããã¯ã³ã¢ãšãªãããäžéšã®åã§ã¯ããŸããããã
// ã»ãšãã©ã®å Žåã¯èªåã§åãäœãå¿
èŠãããã
// åã«é¢ããŠã®è©³çŽ°ãäžèšã®ã¹ã©ã€ãåç
§ã
val paramsStack = Stack [ Tree ](( params map ( _ . tree)) : _ * )
val refs = s_format. split( "(?<=%[\\w%])|(?=%[\\w%])" ) map {
case "%d" => precompute( paramsStack. pop, typeOf[ Int ])
case "%s" => precompute( paramsStack. pop, typeOf[ String ])
case "%%" => Literal ( Constant ( "%" ))
case part => Literal ( Constant ( part))
}
// ãããŠæåŸã«çæããã³ãŒãã®å
šãŠã Block ãžãšçµã¿åãããã
// 泚ç®ããŠã»ããã®ã¯ reify ã®åŒã³åºãã ã
// AST ãæã£åãæ©ãäœæããæ¹æ³ãæäŸããŠããã
// reify ã®è©³çŽ°ã¯ããã¥ã¡ã³ããŒã·ã§ã³ãåç
§ããŠã»ããã
val stats = evals ++ refs. map( ref => reify( print( c. Expr [ Any ]( ref). splice)). tree)
c. Expr [ Unit ]( Block ( stats. toList, Literal ( Constant (()))))
}
}
Read MoreâŠ
2012-07-31
ãã¯ãã®äœè
ãšããŠä»æ³šç®ã济ã³ãŠãã Eugene Burmako ãããšããã¯ãã䜿ã£ãŠèšèªçµ±åãããããŒã¿ããŒã¹æ¥ç¶è¡ãã©ã€ãã©ãª SLICK ã®äœè
ã§ãã Jan Christopher Vogt ãããä»å¹Žã® Scala Days ã§è¡ã£ãçºè¡šã®ã¹ã©ã€ãã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2012幎4æ18æ¥ Eugene BurmakoãJan Christopher Vogt è
2012幎7æ30æ¥ e.e d3si9n èš³
Scala ãã¯ã
(é ãããããããã«) ã³ã³ãã€ã©ãæ¡åŒµããæš©éãéçºè
ã«äžãã!
ããã¯ã³ã³ãã€ã«æã«ä»¥äžãè¡ã:
æ€æ»
åŠç
AST å€æ
ã³ãŒãçæ
ã©ã³ã¿ã€ã ãžã® AST ã®é
å
蚳泚: Scala ãã¯ã㯠2.10 ããå°å
¥ãããã³ã³ãã€ã«æã«ã³ãŒãã眮æããæ©æ§ã ãããã«ããä»ãŸã§ãã€ã©ãŒãã¬ãŒããå¿
èŠã ã£ããã®ãèªåçæã§ããããã«ãªããªã©ãããé«ãè¡šçŸåãæã«ããããšãã§ããã
2012-07-22
ãã㯠Scala ããã°ã©ãã®ããã® C# LINQ æ©èœã®èŠãæžãã ããéãšããŠã䜿ããã¯ãã
åæšè«
C# ã«ã¯åæšè«ããããå人çã«ãããŒã«ã«å€æ°ã§ã¯ã§ããã ã var
ã䜿ãããã«ããŠããã
var x = 1;
Scala ã«ã var
ããããã©ãå¯èœãªãäžå€ (immutable) 㪠val
ã䜿ãã®ã奜ãŸãããšãããŠããã
æ°ãã List ãš Array ã®äœæ
C# ã¯ã€ã³ã©ã€ã³ã§ã³ã¬ã¯ã·ã§ã³ãäœãããšãã§ããã
using System.Collections.Generic;
var list = new List { “Adam”, “Alice”, “Bob”, “Charlie” };
var array = new [] { 0, 1, 2 };
2012-06-08
/ sbt
ã€ãã« final ããªãªãŒã¹ããããsbt 0.12.0 ã®å€æŽç¹ ãèš³ããŸããã
ãã€ããªããŒãžã§ã³ãšããæŠå¿µãå°å
¥ãããããšã§ãScala 2.9.0 ã§å
¥ã£ããã©ããŸã掻çšãããŠããªã Scala ã®åŸæ¹ãã€ããªäºææ§ãããæ£é¢ã«åºãŠããããã«ã±ãšãªããšæããŸãã
äºææ§ã«åœ±é¿ã®ããæ°æ©èœããã°ä¿®æ£ããã®ä»ã®å€æŽç¹
Scala 2.10 以éã® Scala åã³ sbt ãã©ã°ã€ã³ã®ã¯ãã¹ããŒãžã§ã³èŠçŽã®å€æŽã (詳现ã¯ä»¥äžã®é
ç® )
çŽæ¥å®è¡ãããå Žåã匷å¶çã« update
ãå®è¡ããããã«ããã #335
sbt ãã©ã°ã€ã³ãªããžããªããã©ã°ã€ã³ãšãã©ã°ã€ã³ã®å®çŸ©ã«ããã©ã«ãã§å ãã£ãã #380
ãã©ã°ã€ã³èšå®ãã£ã¬ã¯ããªã®åªå
é äœã (詳现ã¯ä»¥äžã®é
ç® )
ãœãŒã¹äŸåæ§ã®ä¿®æ£ã (詳现ã¯ä»¥äžã®é
ç® )
éçŽãããæè»ã«ãªã£ãã (詳现ã¯ä»¥äžã®é
ç® )
ã¿ã¹ã¯è»žã®æ§æã key(for task)
ãã task::key
ãžãšå€æŽãããã (詳现ã¯ä»¥äžã®é
ç® )
sbt ã® organization ã org.scala-sbt
ãžãšå€æŽãããã(å
ã¯ãorg.scala-tools.sbt) ç¹ã«ãscripted ãã©ã°ã€ã³ã®ãŠãŒã¶ã¯ãã®åœ±é¿ãåããã
artifactName
ã®åã (ScalaVersion, ModuleID, Artifact) => String
ãšãªã£ãã
javacOptions
ãã¿ã¹ã¯ãšãªã£ãã
session save
㯠build.sbt
å
ã®èšå®ãïŒé©åãªæã«ïŒäžæžãããããã«ããã#369
æ°æ©èœ
ãã¹ãã®ãã©ãŒã¯ã®ãµããŒãã #415
test-quick
ã (#393 )
ãªããžããªèšå®ã®ã°ããŒãã«ãªãªãŒãã©ã€ãããµããŒãããã #472
åã³ã³ãã€ã«ãããã« unchecked ãš deprecation ã®èŠåã衚瀺ãã print-warnings
ã¿ã¹ã¯ãè¿œå ããã(Scala 2.10+ ã®ã¿)
Ivy èšå®ãã¡ã€ã«ã URL ããèªã¿èŸŒããããã«ããã
projects add/remove
ã§äžæçã«ä»ã®ãã«ããšäœæ¥ã§ããããã«ãªã£ãã
䞊åå®è¡ã®å¶åŸ¡ã®æ¹åã (詳现ã¯ä»¥äžã®é
ç® )
inspect tree
㧠inspect
ãååž°çã«åŒã¹ãããã«ãªã£ãã#274
ãã°ä¿®æ£
ååž°çã«ãã£ã¬ã¯ããªãåé€ãããšãã«ãã·ã³ããªãã¯ãªã³ã¯ãæãå
ã®ã³ã³ãã³ããåé€ããªãããã«ããã
Java ãœãŒã¹ã®èŠªã®æ€ç¥ã®ä¿®æ£ã
update-sbt-classifiers
ã§çšãããã resolver ã®ä¿®æ£ã#304
ãã©ã°ã€ã³ã®èªåã€ã³ããŒãã®ä¿®æ£ã#412
åŒæ°ã®ã¯ãªãŒã #396
Ctrl+Z ã§åæ¢ããåŸ JLine ãæ£ãããªã»ããããããã«ããã(Unix ã®ã¿) #394
æ¹åç¹
ã©ã³ãã£ãŒã 0.7.0 以éå
šãŠã® sbt ãèµ·åã§ããããã«ãªã£ãã
ã¹ã¿ãã¯ãã¬ãŒã¹ãæå¶ãããå Žåãlast
ãåŒã¶ããã«ããæŽç·Žããããã³ãã衚瀺ãããããã«ãªã£ãã
Java 7 ã® Redirect.INHERIT ãçšããŠåããã»ã¹ã®å
¥åã¹ããªãŒã ãç¶æ¿ããããã«ãªã£ãã #462 , #327 ããã§ã€ã³ã¿ã©ã¯ãã£ããªããã°ã©ã ããã©ãŒã¯ããå Žåã«èµ·ããåé¡ã解決ãããã¯ãã (@vigdorchik)
help
ãš task
ã³ãã³ãã®æ§ã
ãªæ¹åãããã³æ°ã㪠settings
ã³ãã³ãã#315
jsch ããŒãžã§ã³ã 0.1.46 ãžãšæŽæ°ã #403
JLine ããŒãžã§ã³ã 1.0 ãžãšå€æŽã (詳现ã¯ä»¥äžã®é
ç® )
ãã®ä»ã®ä¿®æ£ããã³æ©èœæ¹å: #368 , #377 , #378 , #386 , #387 , #388 , #389
å®éšçããããã¯éçºéäž
å·®åã³ã³ãã€ã«ãçµã¿èŸŒãããã® APIããã®ã€ã³ã¿ãŒãã§ã€ã¹ã¯ä»åŸå€æŽããå¯èœæ§ãããããæ¢ã« scala-maven-plugin ã®ãã©ã³ã ã§å©çšãããŠããã
Scala ã³ã³ãã€ã©ã®åžžé§ã®å®éšçãµããŒãã sbt ã« -Dsbt.resident.limit=n
ãæž¡ãããšã§èšå®ãè¡ããn
ã¯åžžé§ãããã³ã³ãã€ã©ã®æ倧æ°ã
æ°ãµã€ã ã® howto ããŒãžãèªã¿ãããããã
倧ããªå€æŽã®è©³çŽ°ç¹
## ãã©ã°ã€ã³ã®èšå®ãã£ã¬ã¯ããª
0.11.0 ã«ãããŠãã©ã°ã€ã³ã®èšå®ãã£ã¬ã¯ããªã¯ project/plugins/
ãããã ã® project/
ãžãšç§»è¡ããproject/plugins/
ã¯éæšå¥šãšãªã£ãã0.11.2 ã«ãããŠéæšå¥šã®ã¡ãã»ãŒãžã衚瀺ãããããå
šãŠã® 0.11.x ã«ãããŠã¯æ§ã¹ã¿ã€ã«ã® project/plugins/
ãæ°ããã¹ã¿ã€ã«ãããé«ãåªå
ãããã0.12.0 ã§ã¯æ°ããã¹ã¿ã€ã«ãåªå
ããããæ§ã¹ã¿ã€ã«ã®ãµããŒã㯠0.13.0 ãåºããŸã§å»æ¢ãããªãã
2012-04-11
/ sbt
XML ããŒã¹ã®ãã«ãããŒã«ãšæ¯èŒãããš sbt ã¯ãã«ãå®çŸ©ã (.sbt ãš .scala ã®äž¡æ¹ãšã) Scala ã䜿ã£ãŠæžããšããéãããããããã«ããäžåºŠ sbt ã®ã³ã³ã»ãããæŒç®åãæŒãããŠããŸãã°ããã«ããŠãŒã¶ã sbt ãã©ã°ã€ã³ãæžãå§ããã®ã«ããŸãåŽåããããªãã
æ¢ã«ãã£ã sbt 0.7 ã®ãã©ã°ã€ã³ã移æ€ããŠãããããªãªãžãã«ã®ãæžããŠããã®ã§ãŸãšããŠçŽ¹ä»ãããã
sbt-dirty-money
sbt-dirty-money 㯠Ivy ãã£ãã·ã¥ãäœãšãªãéžæçã«æ¶å»ããããã®ãã©ã°ã€ã³ã (~/.ivy2/cache
äžã® organization
ãš name
ãå«ããã®)ããã£ã 25è¡ã®ç°¡åãªå®è£
ã ãã©ãclean-cache
ãš clean-local
ã® 2ã€ã®ã¿ã¹ã¯ã¯åã®åœ¹ã«ç«ã£ãŠããã
äŸãã°ãäœããã©ã°ã€ã³ãéçºããŠããŠããããã¹ãçšã® hello ãããžã§ã¯ãã«ãããŠãã£ãã·ã¥ãããŠãããã©ãããäžæã§ãããšããã
ãã©ã°ã€ã³ãããžã§ã¯ãäžãã clean-cache
ãš clean-local
ã®äž¡æ¹ãèµ°ãããhello ãããžã§ã¯ãã reload ããããšã§ãã©ã°ã€ã³ã解決ã§ããªããã©ããã確èªããã解決ã§ããªããã°ãã©ããç¥ããªãæããåŒã£åŒµã£ãŠããŠãããã§ã¯ãªããšããããšãªã®ã§æåã ã
sbt-buildinfo
sbt-buildinfo ã¯åããæžãããšæã£ãŠãããã©ã°ã€ã³ã®äžã€ã ãããã¯ãã«ãå®çŸ©ãã Scala ã®ãœãŒã¹ãçæãããäž»ãªç®çã¯ããã°ã©ã ãèªèº«ã®ããŒãžã§ã³çªå·ãæèããããšã«ãã (ç¹ã«ãconscript ã䜿ã£ãã¢ããªã®å Žå)ã
sourceGenerators
ã䜿ã£ãŠããŒãžã§ã³çªå·ãå«ããªããžã§ã¯ããçæããã¹ã¯ãªãããã¡ãã¡ãã£ãšæžããããšãäœåããã£ãããä»ã®äººã«ã䜿ã£ãŠããããããã«ããã«ã¯ãã©ã°ã€ã³ã«ããã®ãé©ããŠããšæã£ããstate
ããå€ãæœåºããããšã§ sbt-buildinfo ã¯ä»»æã®è€æ°ã®ããŒãã Scala ãœãŒã¹ãçæããã以äžã build.sbt
ã«å ãã:
2012-04-02
䞊åã³ã¬ã¯ã·ã§ã³ã©ã€ãã©ãªã®ã¬ã€ãã翻蚳ããŠãdocs.scala-lang.org ã«åã蟌ãã§ããããŸããã
åæ㯠EPFLã®ç 究ã¢ã·ã¹ã¿ã³ãã§ã䞊åã³ã¬ã¯ã·ã§ã³ã®èšèšæžã§ãã A Generic Parallel Collection Framework (pdf) ãšããè«æã®ç¬¬äžèè
ã§ããã Aleksandar Prokopec ãããš
çŸåšã¢ã¡ãªã«ãã EPFL ã«çåŠäžã§ã䞊åãšåæ£ããã°ã©ãã³ã°ã¢ãã«ãç 究ããŠããŠãã³ãã¥ããã£å
ã§ã¯ããã¥ã¡ã³ããŒã·ã§ã³ãã¡ãŒãšããŠãç¥ããã Heather Miller ããã§ãã
2012-01-16
treehugger ã¯ã³ãŒããçšã㊠Scala ã®ãœãŒã¹ã³ãŒããæžãããã®ã©ã€ãã©ãªã ãããã¯ãŸããRefelection API ã«åºã¥ã Scala AST ã®ä»£æ¿å®è£
ã®äžã€ã§ããããgithub 㧠eed3si9n/treehugger ãšããŠå
¬éããŠããã
æŽæ°:
ãã®èšäºãæ¡åŒµããŠæ¬åœãã£ããã n8han/pamflet ã䜿ã£ãŠã¬ã€ãã«ä»äžããŠã¿ãŸããïŒä»ã®ãšããè±èªã ãã§ãïŒ:
2012-01-07
Scala ãšããèšèªã¯ãåã®äœ¿ã£ãããšã®ããäžã§ã¯æããšã¬ã¬ã³ãã§ãè¡šçŸåã«å¯ã¿ãäžè²«æ§ãããããã€å®å©çãªèšèªã®äžã€ã ãšæãããã¿ãŒã³ãããã³ã°ãçµ±äžåœ¢åŒã¢ã¯ã»ã¹ã®ååãªã©ã¯ããããã®çã®è¯ãã¯ææã«ããšãŸããªãããããŠãScala ãšã³ã·ã¹ãã ãš Scala ã³ãã¥ããã£ãŒã¯ãã®èšèªããã匷åãªãã®ã«ããŠããã
Scala 2.9.1 ã«ãããŠãããŒã«ã«ã§å®£èšããã implicit ã¯ã€ã³ããŒãããããã®ãããåªå
ããããåé¡ã¯ãèšèªä»æ§ã«ã¯ãã®ãããªæ¯ãèãã¯æžãããŠããªãããšã ãåã®åœåã®ä»®èª¬ã¯ãèªåãèšèªä»æ§ãæ£ããç解ããŠããªããããããã¯èšèªä»æ§ã«æãç©Žããããã®ã©ã¡ããã ãããšãããã®ã ã£ãããšã«ããããã®ä»®èª¬ã«åºã¥ããŠæé»ã®ãã©ã¡ãŒã¿è§£æ±ºã®åªå
é äœã«ã€ããŠè²ã
調ã¹ãçµæãå
é±æžãã ããæªããäŒèª¬ãã§ãããèšãããããã«ãå
šãäºæããŠããªãã£ãçµæãåºãŠãããšããæãé¢çœããã®ãšãªããåŸã§åãã£ãã®ã¯ã仮説ã®äž¡æ¹ãšãééã£ãŠãããšããããšã ã
ã€ãŸããé¢é£éšåã«é¢ããåã®ä»æ§ã®ç解ã¯æ£ãããä»æ§ãæ£ãããšããããšã ãSI-5354 ã«ãããšãééã£ãŠããã®ã¯ã³ã³ãã€ã©ã®å®è£
ã ã£ãã
2012-01-02
Northeast Scala Symposium 2012 ãããšæ°ã¶æãšããæã ãã©ã2011幎ããŸãšãããšãã圢ã§å»å¹Žã®ã·ã³ããžãŠã ã§ã®çºè¡šã®äžã€ãåèããŠã¿ããããšã«ãããnescala ã¯æ¬¡ãã次ãžãšã¯ãªãªãã£ã®é«ãçºè¡šããã£ãããããã®å
šãŠã¯ãããã§èŠãããšãã§ãã ãDaniel ã®é¢æ°åã®ããŒã¿æ§é ãš Janas ã® Akka ãããããäžæéã®ããŒããŒãããã£ãããšããããScala ã³ãã¥ããã£ãŒã®äžã« FP ãšã¢ã¯ã¿ãŒãšããäºã€ã®æœ®æµã圢æããã€ã€ããããšãå°è±¡ã«æ®ã£ãïŒPaul ãã¢ã¯ã¿ãŒã®ã¡ãã»ãŒãžã®éä¿¡ã«ã¯åç
§ééæ§ãç¡ããšå®£èšããã®ããã³ãã ã£ããããããªãïŒããŸããäžå¹Žã®ãã®åŸã®äºå
ãšãèšãã Mark ã® sbt 0.9 ã®ãã¬ãŒã³ã Nermin ã«ãã Scala ã®ããã©ãŒãã³ã¹ã«é¢ããèå¯ããã£ããããããåã®äžã§çŽã¡ã«ã³ãŒããå€æŽããå¿
èŠã«è¿«ãããããªçŽæ¥çãªã€ã³ãã¯ããšããæå³ã§æããåºãçºè¡šã¯ Josh ã®çºè¡šã ã£ã: Implicits without the import tax: How to make clean APIs with implicits. ïŒimport çšã®ããããªã implicit: implict ãçšããŠããã«ã¯ãªãŒã³ãª API ãäœããïŒ
æé»ã®ãã©ã¡ãŒã¿è§£æ±º
Josh ã®çºè¡šã®å€§ããªç¹ã¯ãæé»ã®ãã©ã¡ãŒã¿ (implicit parmeter) ã¯ããã€ãã®ã¬ã€ã€ãŒãé çªã«èŠãŠããããšã§è§£æ±ºãããã¯ã€ã«ãã«ãŒã import
ã¯é«ãåªå
é äœãå ãããããã©ã€ãã©ãªãããã䜿ã£ãŠããŸããšãŠãŒã¶ãããããªãŒããŒã©ã€ãã§ããªããªã£ãŠããŸããšããããšã ã£ãã
ãã®ãã¹ãã«ãããŠãimplicit ã®è§£æ±ºåªå
é äœã Scala Language Specification ãèªãã ãã³ãŒãã§è©ŠããŠããããšã§æ¢æ€ããŠããããããã£ãã¡ãªäººã®ããã«ãæçµçã«å°ãã ãããåªå
é äœã以äžã«ç€ºãã:
2011-12-17
ãã㯠Scala Advent Calendar 2011 ã® 17æ¥ç®ã®èšäºã§ãã
specs2 ã®äœè
ã§ããã@etorreborre ãšããŠã掻çºã«çºèšãç¶ããã·ãããŒã®åŒ·è±ª Eric Torreborre ãããæžãã “The Essence of the Iterator Pattern” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2011幎6æ24æ¥ Eric Torreborre è
2011幎12æ17æ¥ e.e d3si9n èš³
å»å¹Žèªãã è«æã§äžçªæ°ã«å
¥ã£ãã®ã¯ “The Essence of the Iterator Pattern” ïŒä»¥äžãEIPïŒã ããããèªãã åŸã§ãä»ãŸã§äœå¹Žã䜿ãç¶ããŠãããããã®ã«å¯Ÿããèããã¬ã©ãªãšå€ãã£ããããã¯ãfor
ã«ãŒãã ã
ãã®è«æã®äžããããã€ãã®ã¢ã€ãã£ã¢ã玹ä»ããŠãæžãããŠãã解æ³ã®å®è£
æ¹æ³ã Scalaz ã£ãœãã³ãŒãã䜿ã£ãŠèª¬æããã以åã«é¢æ°åããã°ã©ãã³ã°ããã¡ã³ã¯ã¿ãã¢ãããªã©ã«å°ãã§ã觊ããããšãããã°ã圹ç«ã€ãšæã!
for ã«ãŒãã®äžèº«ã¯äœã ?
ããããæ¬åœã«åãããã£ãããã«ã±ã ããfor
ã«ãŒãã®äžèº«ã¯äœã ããšã¯ã©ãããæå³ã ? åãäœå¹Žã䜿ã£ãŠãããã®æ§æã«ãäœãéæ³ã¯å
¥ã£ãŠããªãã ããã?
EIP ã®å°å
¥éšã«ãïŒC ã®ãããªæ·»åã䜿ã£ã for
ã§ã¯ãªãïŒåèŠçŽ ãäžã€ã¥ã€é ã«è¿ãã¿ã€ãã® for
ã«ãŒãã®äŸãã§ãŠãããããã§ã¯ãScala ã«å€èº« ãããŠæžããã©ãèãæ¹ã¯äžç·ã :
val basket: Basket [ Fruit ] = Basket ( orange, apple)
var count = 0
val juices = Basket [ Juice ]()
for ( fruit <- basket) {
count = count + 1
juices. add( fruit. press)
}
Read MoreâŠ
2011-11-20
Scala ã®ããŒã«ã䜿ã£ããæ¥åžžã®ã³ãŒãã£ã³ã°ã§ã®ãã¯ããã¯ã玹ä»ãããã
äŸãã°ãããŒã«ãšãã©ã€ãã©ãªãéçºããŠããšããŠããã°å ±åãåãããšããããŸãåå ã®åæã«å
¥ãåã«åãéäžããããšã¯ããŠãŒã¶ã䜿ã£ãŠããã®ãšåãããŒã¿ã§åé¡ãåçŸããããšã ãåé¡ãåçŸã§ããã°ã次ã«åé¡ãåçŽåããŠå€±æãã spec ãæ©èœãã¹ãã«èœãšãããããšã«ç§»è¡ããããã°ãä¿®æ£ããããåŸã§ãåãã»ããã¢ããã䜿ã£ãŠå®éã®ããŒã¿ã§ããã°ãçŽã£ãŠãããã確èªããããšãã§ããã
2011-11-06
/ sbt
sbt ãããžã§ã¯ãããã€ãã«ãå
¬åŒã¬ã€ããšèšãã Getting Started Guide ãåºãŠããã®ã§ã翻蚳ããŸãããåæã¯ãHeroku ã« Scala ãèŒããããªããããŠããTypesafe 瀟㮠Havoc Pennington æ°ã«ããå
šãŠæžãããŠããŸãã
2011-09-25
/ sbt
version 2.0
2011幎6æ19æ¥ã«æåã®ããŒãžã§ã³ãæžããæç¹ã§ã®åã®åæ©ã¯ãéè¯ã Mark ã«ãã sbt 0.10 ã®ãã¢ãäºåãçã§èŠããããšã«è§ŠçºãããŠïŒæå㯠northeast scala ã次㫠scala days 2011 ïŒãsbt 0.7 ãã 0.10 ãžãšçã移è¡ããã®ãæå©ããããã£ãããã ã£ãããã©ã°ã€ã³ãããã£ãŠããªããã°ãã«ããŠãŒã¶ã 0.10 ã«ç§»è¡ã§ããªãããããã©ã°ã€ã³ã移è¡ãžã®å€§ããªåŠšãã«ãªããšããã®ã倧æ¹ã®èãã ã£ããããã§åãåã£ãæŠç¥ã¯ãç¡ããã©ã°ã€ã³ã¯èªåã§ç§»æ€ããŠãã€ãŸããããã¡ãŒãªã³ã°ãªã¹ãã§è³ªåããŠãçµæãããã§ãŸãšãããšãããã®ã ã£ããããã«ãããå€ãã®ããžãã£ããªåå¿ããã£ãããæ°äººã 0.10 ãžç§»è¡ããæå©ãã«ããªã£ããšæããã ãã©ãåŸã»ã©æããã«ãªã£ãã®ã¯ãåã® sbt 0.10 ã«é¢ããç解ã¯å®å
šãªãã®ã§ã¯ãªããæãšããŠå
šãééã£ãŠãã誀解ãäžãããã®ã ã£ããšããããšã ãæ責ã¯åã«ããããå€ãå
容ããã®ãŸãŸæ®ããŠããã®ã§ã¯ãªããgithub ã« push ããŠãæ°ããããŒãžã§ã³ãäœã£ãŠãåãžé²ãããšã«ããããã©ã°ã€ã³ã®äœæã«é¢ããææ°ã®ç¥è㯠Plugins Best Practices ã«ãŸãšããããŠããã倧éšå㯠Brian ãš Josh ãã¡ããã£ãšã ãåã«ããæžãããŠããã
æ
ãŠã㪠(don’t panic)
ãã£ã 0.7 ã®äžçããçéžããã°ã£ããã®åãsbt 0.10 ãããŸãã«ãéãã®ã§ããã¯ãªããããšã ãšæãããã£ããæéããããŠæŠå¿µãç解ããã°ãå¿
ãåããããã«ãªãããsbt 0.10 ã®äºããã£ãšå€§å¥œãã«ãªãããšãçŽæããã
äžã€ã®è¡šçŸ
sbt 0.10 ãšããåãããã®ã«äžã€ã®æ¹æ³ããããããæåã¯æ··ä¹±ãããããããªãã
sbt 0.10 ãèµ·åæã«çŸããã·ã§ã«ã
build.sbt
ã settings
åã«å
¥ã Quick Configurations DSLã
æ®éã® Scala ã³ãŒããå¥å Full Configurationã
ããããã®è¡šçŸã¯å¥ã
ã®äœ¿çšã¢ãã«ã«æé©åããŠãããsbt ãåã«ãããžã§ã¯ãããã«ãããã®ã«äœ¿ã£ãŠããå Žåã¯ãã»ãšãã©ã®æéã publish-local
ãªã©ã®ã³ãã³ãã䜿ã£ãŠãã·ã§ã«ã®äžã§éããã ããã次ã«ã©ã€ãã©ãªã®äŸåæ§ãªã©åºæ¬çãªèšå®ã®å€æŽãè¡ãããå Žåãbuild.sbt
ã® Quick Configurations DSL ã«ç§»è¡ãããæåŸã«ããµããããžã§ã¯ããå®çŸ©ãããããã©ã°ã€ã³ãæžãå Žåã«ã¯ãFull Configuration ã䜿ãããšã§ Scala ã®ãã¯ãŒãçºæ®ããããšãã§ããã
2011-09-18
/ sbt
ãã¹ãã®è©±ãããããäžåºŠãã©ã°ã€ã³ãæžããŠããŸããšãã©ãããŠãé·æçãªãã®ã«ãªã£ãŠããŸããæ°ããæ©èœãå ãç¶ããïŒãããã¯ãã°ãçŽãç¶ããïŒããã«ã¯ãã¹ããæžãã®ãåççã ãã ãã©ããã«ãããŒã«ã®ãã©ã°ã€ã³ã®ãã¹ããªããŠã©ããã£ãŠæžãã°ãããã ããïŒãã¡ããé£ã¶ãã ãã
scripted test framework
sbt ã¯ãscripted test framework ãšãããã®ãä»ããŠããŠããã«ãã®çæžããã¹ã¯ãªããã«æžãããšãã§ãããããã¯ãããšããš å€æŽã®èªåæ€ç¥ããéšåã³ã³ãã€ã«ãªã©ã®è€éãªç¶æ³äžã§ sbt èªäœããã¹ãããããã«æžããããã®ã :
ããã§ã仮㫠B.scala ãåé€ããããA.scala ã«ã¯å€æŽãå ããªããã®ãšãããããã§ãåã³ã³ãã€ã«ãããšãA ããåç
§ããã B ãååšããªãããã«ããšã©ãŒãåŸãããã¯ãã ã
[äžç¥ (éåžžã«è€éãªããšãæžããŠãã)]
scripted test framework ã¯ãsbt ã以äžã«æžããããããªã±ãŒã¹ãç確ã«åŠçããŠãããã確èªããããã«äœ¿ãããŠããã
æ£ç¢ºã«ã¯ããã®ãã¬ãŒã ã¯ãŒã¯ã¯ siasia ãšããŠç¥ããã Artyom Olshevskiy æ° ã«ãã移æ€ããã scripted-plugin çµç±ã§å©çšå¯èœã ããããã¯æ£åŒãªã³ãŒãããŒã¹ã«åã蟌ãŸããŠããã
ã¹ããã 1: snapshot
scripted-plugin ã¯ãã©ã°ã€ã³ãããŒã«ã«ã« publish ããããããŸã㯠version ã -SNAPSHOT ãªãã®ã«èšå®ãããã
ã¹ããã 2: scripted-plugin
次ã«ãscripted-plugin ããã©ã°ã€ã³ã®ãã«ãã«å ãããproject/scripted.sbt
:
libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}
Read MoreâŠ
2011-08-29
future ã®å®è£
ã«ã¯æ§ã
ãªãã®ããããã©ãæšæºã©ã€ãã©ãªã®äžã«å
±éã®èŠª trait ãããã°ãç¹å®ã®ãã©ãããã©ãŒã ã¹ã¿ãã¯ã«ã³ãŒããäŸåãããã«ãã®æŠå¿µãè¡šçŸã§ããã®ã«ãšæã£ãŠãããããæã人ãä»ã«ããããã¯åãããªããã©ãã©ã€ãã©ãªã®äœè
ãªããã«ã¯åœ¹ã«ç«ã€ããããªãããªãåãæ¢ããããããsff4s ãæžããåæ©ã ã
future ã£ãŠäœ?
å€åååãããã¯èããããšãããããããªããã©ãäžå¿ããããããããfutureå€ïŒpromise ãšãåŒã°ããïŒã¯æªå®ã®èšç®ãè¡šçŸããã
futureå€ã¯æªå®ã®èšç®ãè¡šçŸããã
ããããã䜿ããã説æã ãã©ãããã ãã§ã¯åãããªããããã§èšå€ã«å«ãŸããŠããã®ã¯ããã®èšç®ã¯è£ã§è¡ãããŠãããšããããšã ãããã¯åãã³ã³ãã¥ãŒã¿å
ã®å¥ã®ã¹ã¬ããããå¥ã®ãµãŒãã®äžãããããªãããè¡ååŸ
ã¡ã§ãŸã èšç®ã¯å§ãŸã£ãŠããããªããããããªãããšã«ãããèšç®ã¯çŸåšã®å¶åŸ¡ãããŒã®å€ã§è¡ãããŠãããšããããšã ã
èšç®ã¯ã©ããå¥ã®æã§è¡ãããã
futureå€ã®ããäžã€ã®åŽé¢ã¯ããã®ãã¡ã«èšç®çµæãåŸããããšããããšã ãScala ã®å Žå㯠def apply()
ãåŒã³åºããªã©ã®æ瀺çãªã¹ããããèŠãããèšç®ãæªå®ã®å Žåã¯ããããã¯(block)ãããã€ãŸããèšç®çµæãåŸããããŸã§åŸ
ããããïŒãããã¯ã¿ã€ã ã¢ãŠãããïŒã
futureå€ããèšç®çµæãåŸãããšãã§ããã
æåã« futureå€ã宣èšãããæã«ã¯èšç®çµæã¯æããããããªããããŸã ç¡ããããããªããããŸãããã°ãããæç¹ã§çµæãå°çãããªããžã§ã¯ãã®å
éšæ§é ãå€æŽããããããããfutureå€ãã解決ã(resolve)ãããšãããåæã«ç¶æ
ãå€ãããã®ãšããã®ã¯ããã°ã©ãã³ã°ã§ã¯ããŸãèŠãããªãã®ã§ãå°ãäžæ°å³ã§ã¯ããã
èšç®çµæã解決ããããã®è£å£ãããã
ãããŸã§ã§ãæãåçŽãªåœ¢ã® futureå€ãèšè¿°ãããå®éã«åœ¹ã«ç«ã€ã«ã¯ä»ã®æ©èœãå¿
èŠã ãã©ãããã§ã䜿ããªãããšã¯ãªããã¡ãã£ãšäœ¿çšäŸãã¿ãŠã¿ãã:
val factory = sff4s. impl. ActorsFuture
val f = factory future {
Thread . sleep( 1000 )
1
}
f() // => ãã㯠1ç§éãããã¯ããåŸã§ 1 ãè¿ã
Read MoreâŠ
2011-05-28
Scalaçã®é¢æ°åããã°ã©ãã³ã°äžæŽŸã代衚ããè«å®¢ã®äžäººã@djspiewak ã 2010幎ã«æžãã “Monads Are Not Metaphors” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2010幎12æ27æ¥ Daniel Spiewak è
2011幎5æ29æ¥ e.e d3si9n èš³
åã¯ä»ãçŽæãç Žããšããã ããããäžå¹Žåãåã¯çµ¶å¯Ÿã«ã¢ããã®èšäºã ãã¯æžããªããšèªåã«çŽæãããæ¢ã«ã¢ããã«é¢ããèšäºã¯æãäœã£ãŠãããèšäºã®æ°ãå€ãããŠãã®å€ãã ãã§å€ãã®äººã¯æ··ä¹±ããŠããããããå
šå¡ãã¢ããã«å¯ŸããŠç°ãªãæ±ãæ¹ãããŠãããããã¢ããã®æŠå¿µãåããŠåŠãŒããšããè
ã¯ãããªããŒãå®å®æã象ãç æŒ ã®ãããŠã£ã³ (蚳泚: ã¢ã©ãç³»éç§æ°) ã®å
±éé
ãæ¢ãåªåããããã¡ã«ãªã£ãŠããã
åã¯ããã®æ··ä¹±ããå©ã話ã®ãµãŒã«ã¹ã«ããããããäžã€è¿œå ãããããªããšã¯ããªãããŸããã©ã®å©ã話ãå®å
šã«ã¯æ£ç¢ºã§ã¯ç¡ããã©ã®å©ããå
šäœåãäŒããããŠããªãããããã€ãã¯éèŠãªç¹ã«é¢ããŠé²éªšã«èª€è§£ãæããããªå
容ã«ãªã£ãŠãããã¡ãã·ã³æçãå®å®ïŒããïŒã«æããã¯ããããšã§ã¯ã絶察㫠ã¢ãããç解ããããšã¯ã§ããªããã¢ãããç解ããå¯äžã®èŠæ¹ã¯ããããããã®ãŸãŸã®å§¿ãã€ãŸãæ°åŠçæŠå¿µãšããŠèŠãããšã ã
2011-04-23
Akka ã®äœè
ãšããŠçã
泚ç®ãéããŠãã Jonas Bonér ã 2008幎ã«æžãã “Real-World Scala: Dependency Injection (DI) ” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2008幎10æ6æ¥ Jonas Bonér è
2011幎4æ22æ¥ eed3si9n èš³
ããŠãå®æŠã§ã® Scala ã·ãªãŒãºç¬¬äºåŒŸã®ä»åã¯ãScala ãçšãã Depenency Injection (DI) ã®å®è£
ãã¿ãŠãããããScala ã¯ãåãã£ãŠããèšèªæ©æ§ã ããçšããŠãäœéããã® DI ãå®çŸã§ããéåžžã«è±ãã§ãã£ãŒããªèšèªã ããå¿
èŠã«å¿ããŠæ¢åã® Java DI ãã¬ãŒã ã¯ãŒã¯ã䜿ãããšãã§ããã
Triental ã§ã¯ãäžã€ã®æŠç¥ã«èœã¡çããŸã§äžã€ã®ç°ãªãæ¹æ³ãè©Šããã以äžã®ããã«è©±ãé²ããŠããããŸããçŸè¡ã® DI ã®å®çŸæ¹æ³ã詳ãã説æããåŸã§ãè©Šããä»ã®æ¹æ³ãç°¡åã«ã«ããŒããã
Cake ãã¿ãŒã³ãçšãã
ç§ãã¡ãçšããŠããçŸè¡ã®æŠç¥ã¯ããããã Cake ãã¿ãŒã³ã«åºã¥ããŠããããã®ãã¿ãŒã³ã¯ãMartin Odersky ã®è«æ Scalable Component Abstractions ã«ãããŠãOrdersky ãšåœŒã®ããŒã ã Scala ã®ã³ã³ãã€ã©ãæ§æããæ¹æ³ãšããŠæåã«çºè¡šãããããã®ãã¿ãŒã³ãã©ã®ããã«ã㊠DI ãå®çŸããã®ããšããããšãæ¥æ¬èªã§èª¬æããäºãè©Šã¿ãããããïŒç§ãã¡ã®å®éã«äœ¿ã£ãŠããã³ãŒãã«å€§ãŸãã«åºã¥ããïŒæçŽãªãµã³ãã«ã³ãŒããã¿ãŠã¿ããã
泚æ:
é ãè¿œã£ãŠãæçµããŒãžã§ã³ã«åããŠãªãã¡ã¯ã¿ãªã³ã°ããªãã説æããŠããã®ã§ãæçµããŒãžã§ã³ãèªãã§ç解ãããŸã§ã¯ãããã¡ããã!ããšå«ã¶ã®ã¯åŸ
ã£ãŠã»ããïŒãã¡ãããèªäºåŸã«ã©ãããŠããšèšããªãæ¹å€ãè³è³ãæèŠãã¢ã€ãã£ã¢ãªã©ãéã£ãŠãããïŒããŸãããã®ãµã³ãã«ã³ãŒãã¯ããã®ãããªãµã³ãã«ã®äŸã«ããããéåžžã«è€éãªæ¹æ³ã§åãã«è¶³ããªãäºãè¡ã£ãŠããããã«ã¿ããããææ
¢ããŠå€§èŠæš¡ã·ã¹ãã ã§ã®å®éã®ãµãŒãã¹ãæ³åããŠãã©ã®ããã«å¿çšã§ããããæ³åããŠæ¬²ããã
ãŸãã¯ãUserRepository
(DAOãData Access Object) ãå®è£
ãããã
2011-01-03
次ã
ãšã€ããã³ãŒãã玡ãåºã NY Scala ã·ãŒã³ã®äžå¿çååšã§ããç¶ãã @n8han ãäºå¹Žåã«æžãã “Weaving tweed with Scala and Json ” ã翻蚳ããŸããã翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ãã翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããã
2009幎5æ27æ¥ n8han è
2011幎1æ2æ¥ eed3si9n èš³
æœåºå ã¯ãProgramming in Scala ã® 24ç« ã«ã®ã¿èšè¿°ãããŠãã Scala ã®ç§å¯æ©èœã§ããã®æ¥ã®å€§ãããã ãä»ãŸã§ã¯ç case Some(thing) => kerpow(thing)
ã§æºè¶³ã ã£ãã®ããä»ã§ã¯æœåºåãæžããªããã° #scala freenode ã«ãå
¥ããŠããããªãããºã«ãããã° Scala ãã£ã³ãã«ã®ç¡¬æŽŸãªåžžé£ãã¡ã¯åã®ã³ã³ãã¥ãŒã¿ãããã¯ããŠé©ãã»ã©éŠ¬é¹¿ããããŒã«ããŠã¹ãé£ç¶åçããŠïŒãã ã混济ã·ã£ã¯ãŒã·ãŒã³ãé€ãïŒãçªçµã®ãã¢ã¯ãã£ããã®ããã«æå³ã®ããã¿ã€ãã³ã°ãè«Šããªããã°ãããªãã
蚳泚ãä»¥äž Draco ããæç²
ãããµã ã»ã³ãŒãã¬ãŒã·ã§ã³ã¯äººéã®äººæ Œãçµéšããã¹ãŠæ¶ããæ°ããäººæ Œãæ€ãä»ããæè¡ãéçºããã圌ãã¯ãã®æè¡ãçšããŠãæŠéçšã®äººåœ¢ã¢ã¯ãã£ããçã¿åºããã
人圢ãã¡ã¯ããŒã«ããŠã¹ãšããæœèšã§ç掻ããŠããã誰ãã®äººæ Œã移æ€ãããä»»åã«æãã
ã¢ã¯ãã£ãã®äžäººããšã³ãŒã¯èšæ¶ã®ãªã©ã€ãäžã«ãšã©ãŒãèµ·ãããå®å
šã«ã¯èšæ¶ãæ¶ãããŠããªãã£ãã
ãã®æœåºåã¯ã¡ãã£ãšãã¯ã£ãšããŸãããã
åœããããéãåºããåã¯æœåºåããããšããããç¶æ³ã«é©çšããããåªãããäŸãã°ãJavaScript ã€ã³ã¿ããªã¿ãç解ã§ãããæŽèœãªæååãJson ãªããžã§ã¯ãã ãæœåºåã䜿ãã° case
æ§æã§ãã®ããã«åŠçããããšãã§ãã:
import dispatch.json.Js
val echo = Js("""{"acting": "ç¡è¡šæ
ã§åãèŠãŠãã"}""")
object Echo extends Js { val acting = 'acting ? str }
echo match {
case Echo.acting(hmm) => hmm
case _ => "pshaw"
}
res0: String = staring blankly ahead
Read MoreâŠ
2010-12-30
Scala ããããªããä»ã® IDE ãè©ŠããŸããããçµå± TextMate ã«æ»ã£ãŠããŸãã
ä»åå··ã§è©±é¡ã® IntelliJ IDEA ã«äŸ¿ä¹ããã«ããã£ãŠãTwilight theme ãäœããŸããã
2010-12-07
/ scala / scalaxb
çµå±ã®æïŒscalaxb ã®ãŠãŒã¶ã¯ãšã³ãã£ãã£ã»ãªããžã§ã¯ããè¡šçŸããçŸå®ã®åé¡ã«èå³ãããã®ã§ãã£ãŠïŒãããã©ã XML ã«æ°žç¶åãããããšãã£ãããšã§ã¯ãªãïŒã ããïŒãã€ãããŒã¿ãã€ã³ãã£ã³ã°ã®å®è£
ãã·ã³ã°ã«ãã³/ã³ã³ãããªã³ã»ãªããžã§ã¯ãããè¿œãåºããªããã°ãããªãããšã¯åãã£ãŠããïŒã€ãæè¿ãŸã§ããŒã¿ãã€ã³ãã£ã³ã°ã®å®è£
ã¯ä»¥äžã®ããã«çæãããŠãã:
object Address extends rt. ElemNameParser [ Address ] {
val targetNamespace = "http://www.example.com/IPO"
def parser( node: scala.xml.Node ) : Parser [ Address ] =
...
def toXML( __obj : Address , __namespace : String , __elementLabel : String , __scope : scala.xml.NamespaceBinding ) : scala.xml.NodeSeq =
...
}
Read MoreâŠ
2010-11-06
Debasish Ghosh ãã (@debasishg ) ã® “sjson: Now offers Type Class based JSON Serialization in Scala ” ã翻蚳ããŸããïŒ
å
èšäºã¯ãã¡ã: http://debasishg.blogspot.com/2010/07/sjson-now-offers-type-class-based-json.html
(翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ã)
翻蚳ã®ééãçãããã°é æ
®ãªããææãã ãã
é·ãé sjson ã®ã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ API ã¯ãªãã¬ã¯ã·ã§ã³ã«äŸåãããã®ã ã£ãïŒãã®æ¹æ³ã®é·æãšããŠã¯ïŒçžã®äžã§ã¯ãªãã¬ã¯ã·ã§ã³ã«ããå®è£
ãé 匵ã£ãŠããŠã API ã¯äœ¿ããããããããšãã§ãããšããããšã ïŒ
ãããïŒJSON æ§é ãš Scala ã®ãªããžã§ã¯ãã§ã¯åæ
å ±ã®è±ããã«å€§ããªéããããããšãå¿ããŠã¯ãããªãïŒScala ãã JSON ã«ãããšãã«äœããã®åœ¢ã§åæ
å ±ãã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ãããã³ã«ã®äžéšãšããŠä¿åããªããããïŒå¯éå€æãããã®ã¯å Žåã«ãã£ãŠã¯ãšãŠãããªãããŒã§é£ããããšã«ãªãïŒç¹ã« JVM ã§ã¯ type erasure ã®ãã㧠JSONæ§é ã«ã·ãªã¢ã«åãã Scala ãªããžã§ã¯ãã®äžã«ã¯å
ã«æ»ãã®ãã»ãŒäžå¯èœãªãã®ãããã ããïŒ
ver 0.7 ãã sjson ã¯å
ã®ãã®ã«å ããªãã¬ã¯ã·ã§ã³ã䜿ããªã JSON ã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ãããã³ã«ãçšæããïŒããã¯ãŠãŒã¶ãä»»æã®ãªããžã§ã¯ããã JSON ãžã·ãªã¢ã«åããèªåã®ãããã³ã«ãèŠå®ã§ããããã«ãªã£ãïŒãªãã¬ã¯ã·ã§ã³ã«ãã JSON ã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ ã§ã¯ã¢ãããŒã·ã§ã³ã§è¡ã£ãŠãããã®ãã«ã¹ã¿ã ãããã³ã«ãèªåã§å®è£
ããããšã§å®çŸããããšãã§ããïŒ
sjons ã®åã¯ã©ã¹ã«ããã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ã¯ David MacIver ã«ããçŽ æŽããã sbinary (çŸåšã¯ Mark Harrah ã«ããã¡ã³ã ãããã) ã«ã€ã³ã¹ãã€ã¢ãããŠããïŒåããããã³ã«ã䜿ããŸãå®è£
ã¬ãã«ã§ãè²ã
ãšçãŸããŠããã£ãïŒ
2010-11-03
Debasish Ghosh ãã (@debasishg ) ã® “Scala Implicits : Type Classes Here I Come ” ã翻蚳ããŸããïŒ
å
èšäºã¯ãã¡ã: http://debasishg.blogspot.com/2010/06/scala-implicits-type-classes-here-i.html
(翻蚳ã®å
¬éã¯æ¬äººãã蚱諟æžã¿ã§ã)
翻蚳ã®ééãçãããã°é æ
®ãªããææãã ããïŒ
å
æ¥ Twitter äžã§ Daniel ãš Scala ã§ã®åã¯ã©ã¹ã«ã€ããŠè«è°ããŠãããšïŒçªç¶ãã®ãããã¯ã«é¢ããæžãããã ã£ãèšäºãçºèŠããïŒãããèªãã§ãããªãã¯ç¹ã«ç®æ°ããäºãçºèŠããããã§ã¯ãªããïŒåã¯ã©ã¹ã«åºã¥ããæèã¯ããªãã®èšèšã®å¹
ã«äŸ¡å€ãäžããããšãã§ãããšæãïŒãã®èšäºãæžãå§ããã®ã¯ãã°ããåã«èšèšã®çŽäº€æ§ã«ã€ããŠã®èšäº (åæ) ãå
¬éãããšãã®ããšã ïŒ
ãŸã㯠GoF ã® Adapter ãã¿ãŒã³ããå§ãããïŒå§è²åã® Adapter ã¯ããå§ããããåæ(composition)ãšãããã¯ããã¯çšããŠæœè±¡äœ(abstraction) ã©ããããã€ã³ãããïŒ
èšèšã®çŽäº€æ§ã®ãšããšåãäŸã䜿ããšïŒ
case class Address ( no: Int , street: String , city: String ,
state: String , zip: String )
Read MoreâŠ