使其清晰简洁:
1. What is it?
2. Why is it there?
3. How to type it with a normal Keyboard?
4. Thanks!
Run Code Online (Sandbox Code Playgroud)

我正在阅读Pharo by Example这本书。
然而我在 Pharo2 的“世界”菜单中没有找到“类浏览器”。
是不是被“系统浏览器”取代了?
data Seq a = Nil | Cons a (Seq (a,a))
Run Code Online (Sandbox Code Playgroud)
好吧,所以这是一段haskell声明二叉树的嵌套数据类型,
在OCaml中是否有对应部分?
如果是,请在OCaml代码中显示我们.
我试过了,但我想确定这是否与上述相同:
type tree = Leaf of int | Node of int * tree * tree;;
let l = Leaf 3;;
let a = Node (1, l, l);;
let a = Node (1, a, l);;
let a = Node (1, a, l);;
let a = Node (1, a, l);;
let a = Node (1, a, l);;
let rec value tree = match tree with
| Leaf x -> …Run Code Online (Sandbox Code Playgroud) 实例创建方法,如
ClassName new
Run Code Online (Sandbox Code Playgroud)
为了帮助一些细节,
我们可以在抽象类中编写一个算术方法,
然后在子类中双重发送它们.
我们可以在实例创建中使用它吗?
我尝试了新的但它失败了.导致一些预定义的基本新方法.
子类责任发送者选择器即使在子类具有实现方法时也会卡住.
我认为这个论点可能会导致这种情况发生,但是呢?
谁能告诉我们为什么?
在抽象类中我们有这个
fromString: aString
"init with a string"
^self subclassResponsibility
Run Code Online (Sandbox Code Playgroud)
我正在运行这个:
unit := (Units new fromString: aString)
Run Code Online (Sandbox Code Playgroud)
然后发生错误.
其中Units是抽象类.
Travis Griggs目前的方法可以消除错误
是否有实例创建方法的doubledispatch?
我正在阅读一些示例并遇到此代码,谷歌让我失望.
let id = fun x -> x in fun x -> if x> 0 then id [] else (id x) :: [];;
- : int -> int list = <fun>
Run Code Online (Sandbox Code Playgroud)
正如Caml告诉我们的那样,这被证明是一般的功能.
但它有"let"而不是"let rec",而功能名称id在功能体中出现了好几次.
这看起来不合逻辑.
所以我在想
1. is this actually a recursive function?
2. Or they just happen to be different types reusing the same name confusingly.
Run Code Online (Sandbox Code Playgroud)
你能用明确的理由站在具体的基础上,展示你富有洞察力的想法吗?