Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has Scala any equivalence to Haskell's undefined?

Tags:

types

scala

When coding in Haskell it is helpfull to define function results as "undefined" while you write the skeleton of your application. That way the executable compiles and let's you work in order parts/cases under your attention.

Is there any equivalent thing in Scala? I'd like to write something similar to:

def notAbleToWriteThisYet = undefined
like image 259
tonicebrian Avatar asked Jan 20 '12 15:01

tonicebrian


1 Answers

def notAbleToWriteThisYet = sys.error("todo")

Also see this thread on the mailing list.

Scala 2.10.0-M1:

def notAbleToWriteThisYet = ???

(defined in Predef.scala as def ??? : Nothing = throw new NotImplementedError.)

like image 190
Debilski Avatar answered Nov 08 '22 18:11

Debilski