我看到这个代码在这个博客: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