aspose file tools*
The moose likes Scala and the fly likes What is implicit in Scala/Play and why we mark request as implicit in Play framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Scala
Bookmark "What is implicit in Scala/Play and why we mark request as implicit in Play framework" Watch "What is implicit in Scala/Play and why we mark request as implicit in Play framework" New topic
Author

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

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689

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.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Khuma Chhakchhuak
Ranch Hand

Joined: Nov 30, 2012
Posts: 37

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

Joined: Sep 26, 2006
Posts: 9639
    
    2

I find sometimes using implicits are a bit confusing if you do not understand them thoroughly.


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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is implicit in Scala/Play and why we mark request as implicit in Play framework