我看到這個代碼在這個博客:Type-Level Programming in Scala:`#`運算符在Scala中的含義是什麼?
// define the abstract types and bounds
trait Recurse {
type Next <: Recurse
// this is the recursive function definition
type X[R <: Recurse] <: Int
}
// implementation
trait RecurseA extends Recurse {
type Next = RecurseA
// this is the implementation
type X[R <: Recurse] = R#X[R#Next]
}
object Recurse {
// infinite loop
type C = RecurseA#X[RecurseA]
}
有中,我從來沒有見過的代碼R#X[R#Next]
操作#
。由於很難搜索它(被搜索引擎忽略),誰能告訴我這是什麼意思?
「英鎊符號」有時被稱爲「八字符」(谷歌搜索帶我到這個頁面)。 – philwalk 2016-01-01 19:44:10
使[octothorpe或octothorp](https://en.wikipedia.org/wiki/Number_sign) – smparkes 2016-03-13 23:09:53
Whatabout其他運算符,如#+和# - (請參閱https://github.com/tpolecat/doobie/blob/series /0.4.x/yax/h2/src/main/scala/doobie/h2/H2Transactor.scala)?有全面的清單嗎? – 2017-02-05 06:53:21