Wednesday, 22 May 2013

Scala Equality in 30 seconds


  1. In scala == delegages to equals method.

  2.  a == b is equivalent to a equals b
  3. If you want to check referrential equality you call eq method. 

  4.  a eq b is true only if a and b are referrences to the same object
  5. Case classes and Value Classes (2.10) get the equals and hashcode based on class parameters for free.


End of the story!

Sunday, 24 March 2013

The simplest dynamically typed json parsing with Dynamic in Scala 2.10

I love the way dynamically typed languages handle json or xml parsing. With Scala 2.10 we can do it using Dynamic trait. Here is a first draft.
Please feel free to copy/paste/reuse at your own risk.

The simplest Async Scala Http Client working with 2.10

This client is not the most efficient or the most async but it works and I am using it for testing my apps. Please feel free to copy/paste/reuse at your own risk.