2014-07-01から1ヶ月間の記事一覧

Scala Tutorialsを読む 30 Classes - continued

30 Classes - continued 30 クラスの続き Uniform Access 統一アクセス Scala's getters and setters use the principle of uniform access, e.g. if you change the implementation of a field declared var name to a method def name you will not need t…

Scala Tutorialsを読む 29 Classes

29 Classes クラスの話は長いので、11日だけどあるていど書いてしまいます。30で終わりなのでもう少しです! 29 クラス http://scalatutorials.com/tour/interactive_tour_of_scala_classes.html classes can be defined with minimal amount of code クラ…

Scala Tutorialsを読む 28 Immutable collections with var

http://scalatutorials.com/tour/interactive_tour_of_scala_immutable_collections_with_var.html 28 Immutable collections with var 28 varでのイムータブルコレクション One thing to note is the difference between the +=, +==, -=, -== etc function…

Scala Tutorialsを読む 27 Mutable Collections Operations

27 Mutable Collections Operations ムータブルコレクション演算 http://scalatutorials.com/tour/interactive_tour_of_scala_mutable_collections_operations.html Mutable collections allow to add / remove a single / multple items while modifying th…

Scala Tutorialsを読む 26 Mutable Collections

http://scalatutorials.com/tour/interactive_tour_of_scala_mutable_collections.html 26 Mutable Collections Scala "encourages" using immutable collections (hence they are those used by default) however sometimes mutable collections might have…

Scala Tutorialsを読む 25 Maps

http://scalatutorials.com/tour/interactive_tour_of_scala_maps.html 今日は、Map、写像ですね。 Maps are constructed simply using Map(key1 -> value1, key2 -> value2, ...) Mapは単純にMap(キー1->値1,キー2->値2,...)を使って構築します。 The Map c…

Scala Tutorialsを読む 24 Sets

http://scalatutorials.com/tour/interactive_tour_of_scala_sets.html 24 Sets 集合 Sets are constructed simply using Set(element1, element2, ...) 集合は単純にSet(要素1,要素2,...)を使って構築されます。 The Set can contain mixed types, but the …

Scala Tutorialsを読む 23 Lists

http://scalatutorials.com/tour/interactive_tour_of_scala_lists.html ここを読みます。 List are constructed simply using List(element1, element2, ...) ListはシンプルにList(要素1,要素2,...)を使って作成される List elements can be of any type, …

Scala Tutorialsを読む 22-3

http://scalatutorials.com/tour/interactive_tour_of_scala_arrays.html Since they are using Java's arrays, to print nicely an Array's content, use .mkString(",") Javaの配列を使っているので、配列は.mkString(",")を使ってプリント出来ます。 Arra…

Scala Tutorialsを読む 22-3

http://scalatutorials.com/tour/interactive_tour_of_scala_arrays.html Arrays are mutable (can't change it's size once created, but can modify it's elements) 配列は書き換え可能です(1度作ったらサイズは変更出来ない、しかし要素は変更出来る)

Scala Tutorialsを読む 22-2

http://scalatutorials.com/tour/interactive_tour_of_scala_arrays.html 日付ズレすぎたので、リアルな時間で書いてきます。 Arrays in Scala map to Java primitive Arrays (e.g. Java's int is Scala's Array[Int], Java's String is Array[String] in Sc…