문제

I read in the interview with Rich Hickey that he would be interested in "using logic systems in place of a type system for Clojure". I also bumped into this statement in a SO answer, https://stackoverflow.com/a/6324228/380587 I can't see how logic and type system are related.

도움이 되었습니까?

해결책

Clojure as of now uses type system provided by JVM. You can implement a new type system on top of it using plain old macros. This new type system can also provide runtime checks as well. As far as the type checker is concerned (either for existing JVM based type system or for your own macros based type system), that can be implemented using core.logic and the relationship between a type checker and core.logic is that a type checker task is to look at the static type annotations in your code and verify that the constraints and relations are satisfied and core.logic is a system which can be used to do solve problem which are inherently constrain and relation check related.

So basically, type checker is a problem which fits with what kind of problems you can solve using logic programming.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top