KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So far implicit parameters in Scala do not look good for me -- it is too close to global variables, however since Scala seems like rather strict language I start doubting in my own opinion :-). Question: could you show a real-life (or close) good example when implicit parameters really work. IOW: something more serious than showPrompt , that would justify such language design. Or contrary -- could you show reliable language design (can be imaginary) that would make implicit not neccessary. I think that even no mechanism is better than implicits because code is clearer and there is no guessing. Please note, I am asking about parameters, not implicit functions (conversions)! Updates Global variables Thank you for all great answers. Maybe I clarify my "global variables" objection. Consider such function: max(x : Int,y : Int) : Int you call it max(5,6); you could (!) do it like this: max(x:5,y:6); but in my eyes implicits works like this: x = 5; y = 6; max() it is not very different from such construct (PHP-like) max() : Int { global x : Int; global y : Int; ... } Derek's answer This is great example, however if you can think of as flexible usage of sending message not using implicit please post an counter-example. I am really curious about purity in language design ;-).
Tags (comma-separated)
Save Edits
Cancel