wood burning stoves 2.0
The moose likes Scala and the fly likes Scala function chaining Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Languages » Scala
Bookmark "Scala function chaining" Watch "Scala function chaining" New topic
Author

Scala function chaining

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9726
    
    2

I'm trying a simple function chaining in Scala, but do not understand the strange output! I pass newChars as a List to a function. The value of the List are just a, b, c, d



prints



I was expecting the third println to actually print b and c. But surprisingly it prints a and b. I'm sure that I'm doing something wrong.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9726
    
    2

Oh silly me. Just figured that out!



did what I wanted!
 
Don't get me started about those stupid light bulbs.
 
subject: Scala function chaining