alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (repl-parens.scala)

This example Scala source code file (repl-parens.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

int, int, iterator, repltest, repltest, test, test, x, x

The Scala repl-parens.scala source code

import scala.tools.partest.ReplTest

object Test extends ReplTest {
  def code = """
(2)
(2 + 2)
((2 + 2))
  ((2 + 2))
  (  (2 + 2))
  (  (2 + 2 )  )
5 ;   (  (2 + 2 )  ) ; ((5))
(((2 + 2)), ((2 + 2)))
(((2 + 2)), ((2 + 2)), 2)
((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3) mkString)

55 ; ((2 + 2)) ; (1, 2, 3)
55 ; (x: Int) => x + 1 ; () => ((5))

() => 5
55 ; () => 5
() => { class X ; new X }

def foo(x: Int)(y: Int)(z: Int) = x+y+z
foo(5)(10)(15)+foo(5)(10)(15)

  """.trim
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala repl-parens.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.