-
Recent Posts
Recent Comments
- admin on Thought Of The Day By Unknown Chinese Author
- Stancho Stanchev on Interesting Notes from “Agile Software Development, Principles, Patterns, and Practices” book
- Stancho Stanchev on Lean Principle “Never Fix Later!”
- Stancho Stanchev on Proverb of The Day
- Stancho Stanchev on The Lean Thinking is The Life’s Thinking
Archives
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- December 2009
- November 2009
- October 2009
- August 2009
- June 2009
Categories
Meta
Category Archives: Scala Experience
Scala Repl
Scala, screen cast, Scala REPL, Dick Wall, Escalade Software Continue reading
Posted in Scala Experience
Leave a comment
Scala class examples
Notes on Scala’s class :
Parameters of Scala methods are values (val) not variables (var)
Scala method returns the last value computed by the method
// Scala class with a private member
class Shape{
private var vertexes = 0
}
// Scala class with a method
class Shape{
def … Continue reading
Scala Map Examples
Notes on maps :
- there is mutable and immutable maps
Examples :
import scala.collection.mutable.Map
val rucksack = Map[Int, String]()
rucksack += (1 -> “shawl”)
rucksack += (2 ->”gloves”)
rucksack += (3->”hat”)
println(rucksack)
val ruckSackPile = Map[Int, String](1 -> “shawl”, 2 ->”gloves”, 3->”hat”)
println(ruckSackPile)
Reference:
1. Programming in Scala: A Comprehensiv e … Continue reading
Scala Sets Examples
Notes on sets :
- Scala provides mutable and immutable sets. (scala.collection.mutable, scala.collection.immutable )
Sets examples :
- Sets creating, initializating
scala> import scala.collection.mutable.Set
scala> val teniscordVisitorsSet = Set(“Players”, “Watchers”)
scala> tenisCordVisitorsSet += “Referees”
scala>import scala.collection.immutable.HashSet
scala>val tenisCordVisitorsSet = HashSet(“Players”, “Watchers”)
Reference :
1. Programming in Scala: A Comprehensiv e … Continue reading
Scala Tuples Examples
My notes on tuples :
- tuples are immutable, but unlike lists, tuples can contain different types of elements
- tuples are very useful when you need to return multiple objects
Tuples examples :
- Access to element of tuple
scala > val pair = … Continue reading
Posted in Scala Experience
Leave a comment
Arrays in Scala and its tricky behaviour ;-)
The row bellow shows parametrizing of an array with a String type in Scala.
scala > val greetStrings = new Array[String](3)
If I have to be honest it’s very unclear what is the meaning of “parametrizing of an array” and why is … Continue reading
Scala Variables
Definition of variable with var and val in Scala and the elegant way of definition. Continue reading
Posted in Scala Experience
Leave a comment
Hello World in Scala II ;-)
Notion about Scala’s object. Continue reading