28.08.2016 Views

scala_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Scala<br />

Higher-Order Functions ....................................................................................................................... 82<br />

Anonymous Functions ......................................................................................................................... 83<br />

Currying Functions ............................................................................................................................... 84<br />

12. SCALA – CLOSURES .......................................................................................................... 86<br />

13. SCALA – STRINGS ............................................................................................................. 88<br />

Creating a String .................................................................................................................................. 88<br />

String Length ....................................................................................................................................... 89<br />

Concatenating Strings .......................................................................................................................... 89<br />

Creating Format Strings ....................................................................................................................... 90<br />

String Interpolation ............................................................................................................................. 91<br />

The ‘f’ Interpolator .............................................................................................................................. 92<br />

String Methods .................................................................................................................................... 94<br />

14. SCALA – ARRAYS ............................................................................................................... 98<br />

Declaring Array Variables .................................................................................................................... 98<br />

Processing Arrays ................................................................................................................................ 99<br />

Multi-Dimensional Arrays .................................................................................................................. 100<br />

Concatenate Arrays ........................................................................................................................... 102<br />

Create Array with Range .................................................................................................................... 103<br />

Scala Array Methods ......................................................................................................................... 104<br />

15. SCALA – COLLECTIONS ................................................................................................... 106<br />

Scala Lists .......................................................................................................................................... 106<br />

Creating Uniform Lists ....................................................................................................................... 109<br />

Tabulating a Function ........................................................................................................................ 110<br />

Scala List Methods ............................................................................................................................. 111<br />

Scala Sets ........................................................................................................................................... 114<br />

v

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!