4 ms·
Yah, scala uses "_" a lot: http://www.slideshare.net/normation/scala-dreaded http://www.slideshare.net/normation/scala-dreaded The visual clue is the method/f
by gtani 15y ago
Yah, scala uses "_" a lot:
http://www.slideshare.net/normation/scala-dreaded http://www.slideshare.net/normation/scala-dreaded
The visual clue is the method/function signature which you get from the REPL or IDEA scala plugin. I think F#, O'Caml and haskell programmers rely on these heavily also
(There is talk of deprecating one "_" usage)
http://groups.google.com/group/scala-language/browse_frm/thread/16b0c989a801f026/ http://groups.google.com/group/scala-language/browse_frm/thr...
- jimbokun 15y agoThose myriad different meanings of "_" depending on context is positively Perl-like. Seems like a good Scala style guide would ban the use of it altogether, or just white list a couple of uses. Are both {} and () equally valid delimiters for scoping an anonymous function? If so, always using {} would help to avoid confusion with tuples. { _ + _ } as a function taking two arguments seems just wrong to me. Shouldn't it be { _1 + _2 }?