aspose file tools*
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 Spring in Action this week in the Spring 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: 9426
    
    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: 9426
    
    2

Oh silly me. Just figured that out!



did what I wanted!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scala function chaining