Suche senden
Hochladen
ゼロから始めるScala文法
•
1 gefällt mir
•
1,133 views
Ryuichi ITO
Folgen
初心者向けScala文法の資料です (@Scala関西Summit 2017)
Weniger lesen
Mehr lesen
Software
Melden
Teilen
Melden
Teilen
1 von 31
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
関数プログラミングことはじめ revival
関数プログラミングことはじめ revival
Naoki Kitora
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
ikdysfm
Scala kansai summit-2016
Scala kansai summit-2016
Naoki Kitora
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181
Mahmoud Samir Fayed
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
hwbloom25
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84
Mahmoud Samir Fayed
Артём Акуляков - F# for Data Analysis
Артём Акуляков - F# for Data Analysis
SpbDotNet Community
C++ TUTORIAL 7
C++ TUTORIAL 7
Farhan Ab Rahman
Empfohlen
関数プログラミングことはじめ revival
関数プログラミングことはじめ revival
Naoki Kitora
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
ikdysfm
Scala kansai summit-2016
Scala kansai summit-2016
Naoki Kitora
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181
Mahmoud Samir Fayed
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
Part2 from math import * from simpson import * k=1 def f(x): return (exp(-(x...
hwbloom25
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84
Mahmoud Samir Fayed
Артём Акуляков - F# for Data Analysis
Артём Акуляков - F# for Data Analysis
SpbDotNet Community
C++ TUTORIAL 7
C++ TUTORIAL 7
Farhan Ab Rahman
ECMAScript 6 major changes
ECMAScript 6 major changes
hayato
C++ TUTORIAL 3
C++ TUTORIAL 3
Farhan Ab Rahman
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 52 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 29 of 181
The Ring programming language version 1.5.2 book - Part 29 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184
Mahmoud Samir Fayed
ES6(ES2015) is beautiful
ES6(ES2015) is beautiful
monikagupta18jan
C++ TUTORIAL 6
C++ TUTORIAL 6
Farhan Ab Rahman
The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181
Mahmoud Samir Fayed
Introducción a Elixir
Introducción a Elixir
Svet Ivantchev
BingoConsoleApp
BingoConsoleApp
Imtiazur Syed
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
Mahmoud Samir Fayed
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
Timur Safin
Perceptron
Perceptron
unhas
関数潮流(Function Tendency)
関数潮流(Function Tendency)
riue
C++ TUTORIAL 10
C++ TUTORIAL 10
Farhan Ab Rahman
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
Mahmoud Samir Fayed
Frsa
Frsa
_111
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181
Mahmoud Samir Fayed
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
Ashal aka JOKER
Introduction to Scala
Introduction to Scala
Aleksandar Prokopec
Weitere ähnliche Inhalte
Was ist angesagt?
ECMAScript 6 major changes
ECMAScript 6 major changes
hayato
C++ TUTORIAL 3
C++ TUTORIAL 3
Farhan Ab Rahman
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 52 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 29 of 181
The Ring programming language version 1.5.2 book - Part 29 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184
Mahmoud Samir Fayed
ES6(ES2015) is beautiful
ES6(ES2015) is beautiful
monikagupta18jan
C++ TUTORIAL 6
C++ TUTORIAL 6
Farhan Ab Rahman
The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181
Mahmoud Samir Fayed
Introducción a Elixir
Introducción a Elixir
Svet Ivantchev
BingoConsoleApp
BingoConsoleApp
Imtiazur Syed
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
Mahmoud Samir Fayed
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
Timur Safin
Perceptron
Perceptron
unhas
関数潮流(Function Tendency)
関数潮流(Function Tendency)
riue
C++ TUTORIAL 10
C++ TUTORIAL 10
Farhan Ab Rahman
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
Mahmoud Samir Fayed
Frsa
Frsa
_111
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181
Mahmoud Samir Fayed
Was ist angesagt?
(20)
ECMAScript 6 major changes
ECMAScript 6 major changes
C++ TUTORIAL 3
C++ TUTORIAL 3
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 29 of 181
The Ring programming language version 1.5.2 book - Part 29 of 181
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184
ES6(ES2015) is beautiful
ES6(ES2015) is beautiful
C++ TUTORIAL 6
C++ TUTORIAL 6
The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181
Introducción a Elixir
Introducción a Elixir
BingoConsoleApp
BingoConsoleApp
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
Perceptron
Perceptron
関数潮流(Function Tendency)
関数潮流(Function Tendency)
C++ TUTORIAL 10
C++ TUTORIAL 10
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
Frsa
Frsa
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.5.2 book - Part 66 of 181
Ähnlich wie ゼロから始めるScala文法
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
Ashal aka JOKER
Introduction to Scala
Introduction to Scala
Aleksandar Prokopec
Rust
Rust
Chih-Hsuan Kuo
Go: It's Not Just For Google
Go: It's Not Just For Google
Eleanor McHugh
Functional Programming with Groovy
Functional Programming with Groovy
Arturo Herrero
6. Generics. Collections. Streams
6. Generics. Collections. Streams
DEVTYPE
Monadologie
Monadologie
league
Something about Golang
Something about Golang
Anton Arhipov
ddd+scala
ddd+scala
潤一 加藤
C# 7
C# 7
Mike Harris
Hello kotlin | An Event by DSC Unideb
Hello kotlin | An Event by DSC Unideb
Muhammad Raza
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)
intelliyole
Are we ready to Go?
Are we ready to Go?
Adam Dudczak
JavaScript @ CTK
JavaScript @ CTK
Jakob Mattsson
学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト
Opt Technologies
Benefits of Kotlin
Benefits of Kotlin
Benjamin Waye
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
OdessaJS Conf
Introduction to Groovy
Introduction to Groovy
André Faria Gomes
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212
Mahmoud Samir Fayed
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Fabio Akita
Ähnlich wie ゼロから始めるScala文法
(20)
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
Introduction to Scala
Introduction to Scala
Rust
Rust
Go: It's Not Just For Google
Go: It's Not Just For Google
Functional Programming with Groovy
Functional Programming with Groovy
6. Generics. Collections. Streams
6. Generics. Collections. Streams
Monadologie
Monadologie
Something about Golang
Something about Golang
ddd+scala
ddd+scala
C# 7
C# 7
Hello kotlin | An Event by DSC Unideb
Hello kotlin | An Event by DSC Unideb
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Are we ready to Go?
Are we ready to Go?
JavaScript @ CTK
JavaScript @ CTK
学生向けScalaハンズオンテキスト
学生向けScalaハンズオンテキスト
Benefits of Kotlin
Benefits of Kotlin
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
Introduction to Groovy
Introduction to Groovy
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Mehr von Ryuichi ITO
scala.collection 再入門 (改)
scala.collection 再入門 (改)
Ryuichi ITO
ゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクト
Ryuichi ITO
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
Ryuichi ITO
OUCC LT会2
OUCC LT会2
Ryuichi ITO
サクサクアンドロイド
サクサクアンドロイド
Ryuichi ITO
getstartedc#_2
getstartedc#_2
Ryuichi ITO
getstartedc#_1
getstartedc#_1
Ryuichi ITO
Mehr von Ryuichi ITO
(7)
scala.collection 再入門 (改)
scala.collection 再入門 (改)
ゼロから始めるScalaプロジェクト
ゼロから始めるScalaプロジェクト
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
OUCC LT会2
OUCC LT会2
サクサクアンドロイド
サクサクアンドロイド
getstartedc#_2
getstartedc#_2
getstartedc#_1
getstartedc#_1
Kürzlich hochgeladen
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Marharyta Nedzelska
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
BradBedford3
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Drew Moseley
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
osttopstonverter
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
vyaparkranti
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
manoharjgpsolutions
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
itservices996
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
team-WIBU
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Shane Coughlan
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
RTS corp
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
KrzysztofKkol1
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
andrehoraa
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
akrivarotava
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
RTS corp
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
Roberto Pérez Alcolea
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Angel Borroy López
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Cizo Technology Services
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
Christopher Curtin
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
Anthony Dahanne
Kürzlich hochgeladen
(20)
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
ゼロから始めるScala文法
1.
2.
2
3.
3
4.
4
5.
5
6.
6
7.
7
8.
object Main { def main(args: Array[String]): Unit = { val message1 = "Hello" var message2 = "World" message2 += "!" println(message1 + " " + message2) } } 8
9.
def main(args: Array[String]): Unit = { val message1 = "Hello" var message2 = "World" message2 += "!" println(message1 + " " + message2) } [] Unit void 9
10.
{ val message1 = "Hello" var message2 = "World" message2 += "!" println(message1 + " " + message2) } 10
11.
def twice(x: Int): Int = { x * 2 } def twice(x: Int): Int = x * 2 {} 11
12.
val result = { val x = 1 + 2 if (x < 0) x else x * 2 } 12
13.
val result = { val x = 1 + 2 if (x < 0) x else x * 2 } 13
14.
for {i <- 1 to 3} { println(i) } for {i <- 1 to 3} println(i) val results = for {i <- 1 to 3} i 14
15.
val results1 = for {i <- 1 to 3} yield i val results2 = for { i <- 1 to 5 by 2 j <- 2 to 1 by -1 } yield { val x = i * j x + 1 } 15
16.
val n = 2 val result = n match { case 1 => "1" case 2 | 3 => "2 or 3" case x if x % 2 == 0 => " " + x.toString case x => s" ${x}" } 16
17.
val n = 5 val result = n match { case 1 => "1" case 2 | 3 => "2 or 3" case x if x % 2 == 0 => " " + x.toString case x => s" ${x}" } 17
18.
class Triangle(edges: Array[Int]) { val area = ??? // def printFigure(): Unit = println(" ") } val triangle = new Triangle(Array(3, 4, 5)) println(triangle.area) 18
19.
abstract class Polygon(edges: Array[Int]) { val n = edges.size val area: Double def printFigure(): Unit } class Triangle(edges: Array[Int]) extends Polygon(edges) { val area = ??? // def printFigure(): Unit = println(" ") } val triangle = new Triangle(Array(3, 4, 5)) println(triangle.area) 19
20.
abstract class Polygon private(edges: Array[Int]) { val n = edges.size val area: Double def printFigure(): Unit } object Polygon { def fromEdges(edges: Array[Int]): Polygon = edges.size match { case 3 => new Triangle(edges) case 4 => new Square(edges) case n => ??? } } Polygon.fromEdges(Array(3, 4, 5)) 20
21.
import java.util.Date trait Tag { val createdDate: Date } trait Color { val rgb: RGB } class TaggedGreenTriangle extends Triangle with Tag with Color { val rbg = new RGB(0, 255, 0) val createdDate = new Date } 21
22.
val list1 = (1 to 3).toList val list2 = List(1, 2, 3) val array = Array(1, 2, 3) val odds1 = list1.filter(x => x % 2 == 1) val odds2 = array.filter(x => x % 2 == 1) val sum = list1.sum val twice = list1.map(x => x * 2) val sorted = list1.sorted 22
23.
val list = (1 to 3).toList val odds1 = list.filter(x => x % 2 == 1) val selectOdd: Int => Boolean = x => x % 2 == 1 val odds2 = list.filter(selectOdd) 23
24.
def getData(q: Query): Option[String] = ??? getData(q) match { case Some(str) => println(str) case None => println(" ") } 24
25.
def getNullableString(): String = ??? // val stringOpt = Option(getNullableString()) stringOpt match { case Some(str) => println(str) case None => println("null ") } def throwableMethod(): Int = ??? // val result = try { throwableMethod() } catch { case ex: Throwable => 0 } 25
26.
val list = (1 to 3).toList list.foreach(x => println(x)) def getNullableString(): String = ??? // val stringOpt = Option(getNullableString()) stringOpt.foreach(str => println(str)) 26
27.
27
28.
val x1 = 1 + 2 val x2 = 1.+(2) implicit class MyInt(val x: Int) extends AnyVal { def add(another: Int): Int = x + another } val y1 = 1.add(2) val y2 = 1 add 2 28
29.
class Cat(cry: String) { def apply(postfix: String): Unit = println(cry + postfix) } object Cat { def apply(cry: String): Cat = new Cat(cry) } val cat1 = new Cat(" ") val cat2 = Cat(" ") val cat3 = Cat.apply("
") cat1("!") cat1.apply("!") 29
30.
class Cat(cry: String) val cat = new Cat(" ") // cry private
class Cat(val cry: String) val cat = new Cat(" ") // val println(cat.cry) 30
31.
case class Cat(cry: String) val cat1 = new Cat(" ") val cat2 = Cat(" ") val cat3 = Cat.apply("
") println(cat1.cry) println(cat1.toString) getData(q) match { case Some(str) => println(str) case None => println(" ") } 31
Jetzt herunterladen