9
在Haskell中编写代码时,将函数结果定义为“未定义”是很有用的,因为在编写应用程序的框架时,通过这种方式,可执行文件编译并让您在您的关注下按顺序处理零件/案例。Scala与Haskell的未定义有任何等价关系吗?
Scala中有没有相同的东西?我想写类似于:
def notAbleToWriteThisYet = undefined
在Haskell中编写代码时,将函数结果定义为“未定义”是很有用的,因为在编写应用程序的框架时,通过这种方式,可执行文件编译并让您在您的关注下按顺序处理零件/案例。Scala与Haskell的未定义有任何等价关系吗?
Scala中有没有相同的东西?我想写类似于:
def notAbleToWriteThisYet = undefined
def notAbleToWriteThisYet = sys.error("todo")
也看到这个thread on the mailing list。
的Scala 2.10.0-M1:
def notAbleToWriteThisYet = ???
(在Predef.scala
定义为def ??? : Nothing = throw new NotImplementedError
。)