⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s5.scala

📁 JAVA 语言的函数式编程扩展
💻 SCALA
字号:
/* Here's a fragment of a Scala encoding for the Keris module system;** the compiler claims:**** S5.scala:28: value n in class N of type N.this._N.n** cannot override value n in class M of type M.this._N.n**        val system = new M() with N() {}**                         ^** To me it seems like the code is perfectly fine...*/abstract class M() {    val _N: N;    val n: _N.n;    val _M: M = this;    val m: _M.m = new _M.m();    class m() {        // module body of M    }}trait N {    val _N: N = this;    val n: _N.n = new _N.n();    val _M: M;    val m: _M.m;    class n() {        // module body of N    }}object O {    val system = new M() with N {}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -