This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 9956
    
    3

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: 9956
    
    3

Oh silly me. Just figured that out!



did what I wanted!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Scala function chaining
 
It's not a secret anymore!