Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala模式匹配闭包_Scala_Closures_Akka_Actor - Fatal编程技术网

Scala模式匹配闭包

Scala模式匹配闭包,scala,closures,akka,actor,Scala,Closures,Akka,Actor,我正在尝试匹配一个结束。这可能吗?使用在函数中声明闭包的语法,我将闭包指定为(call:=>Unit) 即。 def foo={ 案例(调用:=>单元=>{1} 案例=>1}尝试案例x:Function1[call,Unit]而不是案例(call:=>Unit) 还可以考虑PartialFunction的isDefinedAt

我正在尝试匹配一个结束。这可能吗?使用在函数中声明闭包的语法,我将闭包指定为
(call:=>Unit)

即。
def foo={
案例(调用:=>单元=>{1}

案例=>1}

尝试
案例x:Function1[call,Unit]
而不是
案例(call:=>Unit)

还可以考虑
PartialFunction
isDefinedAt