summaryrefslogtreecommitdiffhomepage
path: root/scala.html.markdown
diff options
context:
space:
mode:
authorKara Kincaid <kara_kincaid@epam.com>2015-10-13 10:06:11 -0400
committerKara Kincaid <kara_kincaid@epam.com>2015-10-13 10:06:11 -0400
commit45a5a9ed5b45f483a04c3b985be74cbcd38179fe (patch)
tree9d7599079877adda1b28cac75b8bc8f8bf057091 /scala.html.markdown
parent622d4485ab9efd265be83d16abbe8cb12da7934c (diff)
parent59a07411effbd0ed6289e062621deb29fe8641a8 (diff)
fix merge conflict in css.html.markdown
Diffstat (limited to 'scala.html.markdown')
-rw-r--r--scala.html.markdown12
1 files changed, 6 insertions, 6 deletions
diff --git a/scala.html.markdown b/scala.html.markdown
index 7189be10..7f545196 100644
--- a/scala.html.markdown
+++ b/scala.html.markdown
@@ -6,7 +6,6 @@ contributors:
- ["Dominic Bou-Samra", "http://dbousamra.github.com"]
- ["Geoff Liu", "http://geoffliu.me"]
- ["Ha-Duong Nguyen", "http://reference-error.org"]
-filename: learn.scala
---
Scala - the scalable language
@@ -244,10 +243,11 @@ i // Show the value of i. Note that while is a loop in the classical sense -
// comprehensions above is easier to understand and parallelize
// A do while loop
+i = 0
do {
- println("x is still less than 10")
- x += 1
-} while (x < 10)
+ println("i is still less than 10")
+ i += 1
+} while (i < 10)
// Tail recursion is an idiomatic way of doing recurring things in Scala.
// Recursive functions need an explicit return type, the compiler can't infer it.
@@ -566,8 +566,8 @@ sendGreetings("Jane") // => "Hello Jane, 100 blessings to you and yours!"
// Implicit function parameters enable us to simulate type classes in other
// functional languages. It is so often used that it gets its own shorthand. The
// following two lines mean the same thing:
-def foo[T](implicit c: C[T]) = ...
-def foo[T : C] = ...
+// def foo[T](implicit c: C[T]) = ...
+// def foo[T : C] = ...
// Another situation in which the compiler looks for an implicit is if you have