This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is implicit in Scala/Play and why we mark request as implicit in Play framework

 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have gone though multiple posts where they have explained about what is implicit in scala, but still I am confuse what is it and why we make Play request implicit in some case like below and where?



I have also seen that Scala heavily using implicit as in API, and heavily using implicit conversion. I just want to know how scala compiler use implicit, handle implicit argument not passing value, how compiler will work on implicit conversion and all.


Thanks in advance.
 
Khuma Chhakchhuak
Ranch Hand
Posts: 37
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not an expert but all I can say in layman language is ---

Using 'implicit' allows Scala apply its common sense.

For example,

implicit timeout = 12 seconds
// Whatever process/thread you run with this implicit timeout, the thread/process would timeout in 12 seconds even though you do not explicitly specify it. Hope I am not confusing you.




 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find sometimes using implicits are a bit confusing if you do not understand them thoroughly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic