- JDKがinstall済みであること
- java コマンドに環境変数Pathが通っていること
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
lazy val fab: PartialFunction[Base, Int] = { | |
case A(base) => 1 + fabc(base) // PartialFunction#apply の呼び出し。危ない! | |
case B(left, right) => 1 + fabcd(left) + fabcd(right) // 同様 | |
} | |
// 全域関数だと scala コンパイラにはわからない! | |
lazy val fabcd: PartialFunction[Base, Int] = fab orElse { | |
case C => 1 | |
case D => 2 | |
} |
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
import math._ | |
1L // Long型の 1 | |
1:Long // Long型の 1 | |
127:Byte // Byte型の 127 | |
32767:Short // Short型の 32767 | |
(1+2).toLong // Long型への変換 | |
(2+3) toLong // Long型への変換 |
この記事はScala Advent Calendar 2013の7日目の記事です。
昨日は @shogogg さんのScala + sbt-android + IntelliJ で快適Androidアプリ開発でした。
明日は @takezoux2 さんのScalaのParserCombinator実践入門+です。
継続モナドを調べていたら、@terazzo さんのJavaで継続モナドという記事が非常に判りやすかったんですが、サンプルコードがJavaのボイラープレートの嵐でちょっと読むのが辛い感じだったのでScalaで翻訳してみました、というのがこの記事です。
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
scalac: Error: assertion failed: | |
while compiling: /Users/ata/dev/neo/neo4j/community/cypher/cypher-compiler-2.1/src/test/scala/org/neo4j/cypher/internal/compiler/v2_1/planner/logical/steps/ProjectionTest.scala | |
during phase: superaccessors | |
library version: version 2.10.4 | |
compiler version: version 2.10.4 | |
reconstructed args: -Xmax-classfile-name 100 -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Content |