4 ms·
Functional Programming, from Java to Scala, D. Wall
- Robin_Message 16y agoYou can improve on the matching example by adding the line: implicit def string2regexTest(s:String)=new RegexTest(s) //Now we can just do someString @= /regularExpression/ which lets you use @= as you use ~= in Ruby. This looks sort of evil à la monkey-patching, but it isn't nearly as bad as the compiler will complain if more than one implicit ever matches, which prevents the situation where something is redefined under you. This is definitely a good thing Scala has going for it that Ruby doesn't.
- michaels0620 16y agoDoes anyone know if there is going to be a video of the talk available? I haven't been able to find anything so far and as a Java dev currently getting my feet wet with a Scala hobby project, it seemed like an interesting presentation.
- logicalmind 16y agohttp://www.java-tv.com/2010/06/29/funky-java-objective-scala/ http://www.java-tv.com/2010/06/29/funky-java-objective-scala...
- Nycto 16y agoThe article complains about Scala lacking Open Classes: Open classes let you add features at runtime. [snip] It's the kind of thing that would be driving programmers nuts by the end of a 20-year maintenance cycle. But it's a godsend when the developers of the original library weren't prescient enough (or didn't have the time) to develop everything you need. This is what implicit conversions are for: http://www.scala-lang.org/node/130 http://www.scala-lang.org/node/130