小编Vla*_*nko的帖子

安装mercurial-server时"没有这样的存储库hgadmin".

我正在尝试安装mercurial-server.将我的密钥添加到keys/root刷新身份验证后,我尝试克隆hgadmin-repo,但是我收到以下错误:

$ hg clone ssh://hg@<domain>/hgadmin
remote: mercurial-server: no such repository hgadmin
abort: no suitable response from remote hg!
Run Code Online (Sandbox Code Playgroud)

谁知道问题是什么?

mercurial mercurial-server

5
推荐指数
2
解决办法
1615
查看次数

为什么val是稳定的标识符而def不是?

val模式匹配时可以使用类实例的字段:

class A {
  val foo = 37
  def bar = 42
}

def patmat1(a: A, x: Int) {
  x match {
    case a.foo => println("a.foo")
    case _     => println("not a.foo")
  }
}

patmat1(new A, 37) // => a.foo
patmat1(new A, 42) // => not a.foo
Run Code Online (Sandbox Code Playgroud)

我想知道为什么def不能类似地使用?

def patmat2(a: A, x: Int) {
  x match {
    case a.bar => println("a.bar")
    //     ^ error: stable identifier required, but a.bar found.
    case _     => println("not a.bar")
  }
}
Run Code Online (Sandbox Code Playgroud)

我认为, …

scala pattern-matching

5
推荐指数
1
解决办法
1755
查看次数