2016-11-21 41 views
1

符号是什么:+:Scala编程语言中的意思是什么?符号的含义:+:在Scala中?

object Devices { 
    private[endpoints] def endpoints(myService: MyService[Future], pService: PService[Future]) = 
    "devices"/(
     banDevice(myService, pService) :+: 
     unbanDevice(myService, pService) 
    ) 

这是代码片段。我正在使用finagle库。

  • 我读过,斯卡拉可以有功能名称作为符号。这是一个例子吗?
  • 我在哪里可以找到这个finagle定义方法的防御?
  • 是否可以重写这些方法?
+1

看看https://github.com/finagle/finch/blob/master/docs/endpoint.md#coproduct-endpoints –

+1

它没有特殊的含义。它只是一个已经导入的库中定义的方法的名称。 – jwvh

+1

另外..请包括任何可能影响您的问题的主要图书馆的细节。例如 - Finagle和芬奇在这种情况下。 –

回答

2

在回答你的问题的更新:

  • 是的,代码调用名为:+:功能(实际上是一个方法)。
  • 您可以在线发布API(可能为here)。
  • 如果该类不是sealed而该方法不是final那么,是的,您应该可以覆盖它。