比如我们有 类 vehicle {速度: int, 价格: int}, boat{速度: int, 价格: int, 排水量:int}, 所以船类是交通工具类的子类
现在有 f ( g: Vehicle → int) = ... g( new(Vehicle)), 意思是函数 f 以 另一个函数 g : Vehicle → int 为参数
1. 请问我可以让 f 以( h: Boat → int) 为参数吗?可以举一个 f 的具体例子吗?
2. 我知道 (Vehicle → int) 是 (Boat → int)的子类,但是我只知道这个是对的,但是理解不了很迷糊,可以解释一下吗?
谢谢!
现在有 f ( g: Vehicle → int) = ... g( new(Vehicle)), 意思是函数 f 以 另一个函数 g : Vehicle → int 为参数
1. 请问我可以让 f 以( h: Boat → int) 为参数吗?可以举一个 f 的具体例子吗?
2. 我知道 (Vehicle → int) 是 (Boat → int)的子类,但是我只知道这个是对的,但是理解不了很迷糊,可以解释一下吗?
谢谢!

