Replies: 3 comments 2 replies
-
关于 solution 的垃圾回收,可以在每次 |
Beta Was this translation helpful? Give feedback.
0 replies
-
如果 |
Beta Was this translation helpful? Give feedback.
0 replies
-
evaluate Pi: case "Pi": {
return Values.Pi(
evaluate(solution, env, core.argType),
Closure(env, core.name, core.retType),
)
} 这里的 感觉这样 否则定义不了 export function applyClosure(closure: Closure, arg: Value): Value {
return evaluate(EnvCons(closure.name, arg, closure.env), closure.body)
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
以
infer2
为例:infer2
发现了两个ImplicitPi
--implicit A: Type, implicit B: Type
ImplicitAp
得到infer2(implicit A)(implicit B)
作为inferred.core
inferred.type
其实是(x: A, y: B) -> Type
,用这个Pi
来check
两个参数(sole, "abc")
check
的过程中,如果可以infer
参数,得到inferred.argType
,就solve(solution, inferred.argType, givenArgType)
evaluate
也要带有solution
参数,在遇到A
和B
的时候,如果在env
里找不到,就去solution
里找Beta Was this translation helpful? Give feedback.
All reactions