On 7/29/11 9:40 AM, Brian Hurt wrote:
I see why Scala made the choice to drop totality checking- you need
global knowledge to determine what states/types are possible for a
given data type.  But note that what you've declared too hard for the
compiler is still necessary for the programmer to do- your code still
has to work correctly with all possible states it can find itself in.

I don't think anyone has declared it too hard for the compiler. Rather, it is impossible for the compiler.

object Foo { def unapply(x: Any): Option[Bar] = { ...? } }

Now we could (and may yet) devise an avenue whereby the programmer can communicate to the compiler more information about how extractors cover the match space, such that exhaustiveness checking can gain sophistication. But even global knowledge isn't enough: we're not about to solve the halting problem.

You've made the expression problem much, much harder to solve, and
sacrificed a huge quanta of correctness, on the altar of OO
compatibility.

I don't think OO compatibility has anything to do with it.

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to 
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to