プログラムは動かさないと始まらない!最初は動かなくて嵌るかもしれない。 でも自分の手を動かして書いたソースが動き始めるともっと書きたくなってくるはず! 手を動かすことに喜びを感じたら、プログラミングの才能があるね! 最初はうまく書けなくても良いんだよ。 とにかくソースを書いて動かしてみようぜ!! 事前準備 まずは動作環境が必要だ。Windows7しか想定してない。すまん。 JavaとScalaのインストール・ダウンロード 以下のバージョンでダウンロードしインストールする。 Java SE 7u21 http://www.oracle.com/technetwork/java/javase/downloads/index.html scala-2.10.1 http://www.scala-lang.org/downloads 環境変数の設定 JAVA_HOME JAVA_HOME=C:\P
Option型って知っているかい?これマジ凄いよ! NullPointerException、通称 ヌルポ 。 少し込み入ったJavaアプリを作って動かすと、大抵発生するよね。 nullチェックを入れてたり、規約で縛ったりして対応することになると思います。 だけど、コンパイル時に見つけることができれば、、、と思ったことない? Option型を上手く使えれば、コンパイル時にnullチェックみたいなことができてしまうんだ。 とても素敵だよね! では、Option型について語ってみます。 Optionとは 値があるかないかを表す型です。箱って言っても良いかもですね。 Optionは更に2種類のサブクラスを持っている。 Some None Some 値があることを表す型。値を持っている。 None 値がないことを表す型。 Optionを使ってみる 淡白に説明してみたので、早速使ってみよう! Opt
I have seen a function named implicitly used in Scala examples. What is it, and how is it used? Example here: scala> sealed trait Foo[T] { def apply(list : List[T]) : Unit }; object Foo { | implicit def stringImpl = new Foo[String] { | def apply(list : List[String]) = println("String") | } | implicit def intImpl = new Foo[Int] { | def apply(list : List[Int]) = println("Int") | } | } ; def foo[A :
val fruits = List("apple", "banana", "avocado", "papaya") val countsToFruits = // count how many 'a' in each fruit fruits.groupBy(fruit => fruit.count(_ == 'a')) for (count, fruits) <- countsToFruits do println(s"with 'a' × $count = $fruits") // prints: with 'a' × 1 = List(apple) // prints: with 'a' × 2 = List(avocado) // prints: with 'a' × 3 = List(banana, papaya)
We are very happy to announce the final release of Scala 2.10.4! The release is available for download from scala-lang.org or from Maven Central. The Scala team and contributors fixed 33 issues since 2.10.3! In total, 36 RC1 pull requests, 12 RC2 pull requests and 3 RC3 pull requests were merged on GitHub. Known Issues Before reporting a bug, please have a look at these known issues. Scala IDE for
We are very pleased to announce the final release of Scala 2.11.0! Get started with the Hello Scala 2.11 template in Typesafe Activator Download a distribution from scala-lang.org Obtain it via Maven Central There have been no code changes since RC4, just improvements to documentation and version bump to the most recent stable version of Akka actors. Here’s the difference between the release and R
We are very pleased to announce the release of Scala 2.11.2! Get started with the Hello Scala 2.11 template in Typesafe Activator Download a distribution from scala-lang.org Obtain it via Maven Central Scala 2.11.2 is a bugfix release that is binary compatible with previous releases in the Scala 2.11 series. The changes include: Several issues in the collections library were resolved, most notably
This proposal has been implemented with some changes in Scala 3.0.0. Authors: Erik Osheim and Jorge Vicente Cantero Supervisor and advisor: Sébastien Doeraene History Date Version Introduction This is a proposal to introduce syntax for type aliases that only exist at compile time and emulate wrapper types. The goal is that operations on these wrapper types must not create any extra overhead at run
By: Martin Odersky and Jeff Olson and Paul Phillips and Joshua Suereth Note from the SIP Committee: we think future SIP(s), using work from SIP-15, can provide more benefit to numerical computing users. The SIP as it exists benefits all users of implicit enrichment classes, and takes us much further to unboxed high performance code. This SIP does not exclude further work towards improving numerica
Mark Harrah 著 Eugene Yokota 訳 はじめに 値クラス (value class) は実行時のオブジェクトの割り当てを回避するための Scala の新しい機構だ。 これは新たに定義付けされる AnyVal のサブクラスによって実現される。 これは SIP-15 にて提案された。 以下に最小限の値クラスの定義を示す: これはただ1つの、public な val パラメータを持ち、これが内部での実行時のデータ構造となる。 コンパイル時の型は Wrapper だが、実行時のデータ構造は Int だ。 値クラスは def を定義することができるが、val、var、または入れ子の trait、class、object は許されない:
sbt Reference Manual 始める sbt sbt のインストール macOS への sbt のインストールWindows への sbt のインストールLinux への sbt のインストール 例題でみる sbtディレクトリ構造実行ビルド定義マルチプロジェクト・ビルドタスク・グラフスコープ値の追加スコープ委譲 (.value の照会)ライブラリ依存性プラグインの使用カスタムセッティングとタスクビルドの整理まとめ付録: bare .sbt ビルド定義 インフォメーション 変更点 sbt 1.0.0 各論 プラグインとベストプラクティス 一般的なベストプラクティスsbt プラグインをテストする How to ソースファイル/リソースファイルの生成逐次実行 Def.sequential を用いて逐次タスクを定義するDef.taskDyn を用いて動的タスクを定義するインプットタスク
Martin Odersky and Lex Spoon These pages describe the architecture of the Scala collections framework in detail. Compared to the Scala 2.8 Collections API you will find out more about the internal workings of the framework. You will also learn how this architecture helps you define your own collections in a few lines of code, while reusing the overwhelming part of collection functionality from the
自分用。気がついたら追加していく。 ユーザグループによる採用事例一覧もあるけど、 自分が見つけたスライドとかへのポインタも兼ねてるので一旦残しておく。 またScalaMatsuriのスポンサーを見てみるのも、Scalaに力をいれている会社を眺めるのに良いかもしれない。 http://2017.scalamatsuri.org/#sp http://2016.scalamatsuri.org/#sp 国内 株式会社ドワンゴ(ニコニコ生放送、モバイル系?) http://www.slideshare.net/kmizushima/scala-mizushima http://www.slideshare.net/sifue/developers-summit-2014-play2scalaweb https://speakerdeck.com/tlync/guo-ji-to-scala-jap
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? こんにちは、アカウンティング・サース・ジャパンの永井です。 突発企画として技術書をテーマに語り合う技術書座談会を社内で開催してみたので、そちらのレポートになります。 書籍座談会とは? 「普通の技術ブログともまた違ったことしたいね」という話をしていたところ、自分たちが使っている技術の情報を探すときに意外と困るという話が出ました。 そこで、私たちが採用しているScalaについての技術書を、うちの技術の偉い人を中心にエンジニア数名でレビュー、ディスカッションしてオススメ度や感想をまとめたら面白そうということで実施してみました。 本日のテーマ
Classpaths, sources, and resources This page discusses how sbt builds up classpaths for different actions, like compile, run, and test and how to override or augment these classpaths. Basics In sbt, the classpath includes the Scala library and (when declared as a dependency) the Scala compiler. Classpath-related settings and tasks typically provide a value of type Classpath. This is an alias for S
最近、Scalaを書き始めてみました。 並列処理が書きやすくて、うまく書けたときは面白く感じますが、まだまだ言語の仕様を覚えきれてなかったり、そもそも関数型言語としての書き方ができていないかなーという感じです。 そんな中、ちょっとしたアプリを作る機会があったので、ScalaのCI環境を作りしながら進めてみました。 手順をメモがてら残しておこうと思います。 利用したツールの構成としては、Jenkins + ScalaTest + scoverage + Scalastyle な感じです。 とりあえずJenkinsでテストを動かすまで Scalaプロジェクト側の設定 ScalaTestの設定 利用するテストフレームワークのライブラリを設定する。 build.sbtのlibraryDependenciesに以下の内容を追記する。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く