skip to main
|
skip to sidebar
Andy's Scala notes
Wednesday, 27 May 2009
Scala - Alternative to instanceOf
Use a match...case statement:
Is tree1 an instance of Node[T]?
tree1 match {
case tree1: Node[T] => true
case _ => false
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Nuclear Carrot - Andy's website
Labels
actors
(1)
anonymous type
(1)
cast
(1)
functions
(5)
implicits
(1)
instanceOf
(1)
lift
(1)
links
(2)
list
(4)
loop
(3)
map
(1)
option[T]
(1)
string
(2)
tuples
(1)
xml
(1)
No comments:
Post a Comment