вторник, 30 июля 2019 г., 4:40:40 UTC+3 пользователь Sam Tobin-Hochstadt написал:
> > I'm not exactly sure what you're asking for here -- the CL type system > works very differently -- but local annotation is certainly possible > in Typed Racket. The `ann` form allows you to annotate any expression > at all, ie `(ann 17 Integer)`. > > Sam > The idea is you don't need to write this annotations. You can if you want. In typed racket it is demand. This became problem with untyped libraries, especially when they produce complex data. Or have complex macros. Sometimes this catches you with iterations. Simple example (define (test-f a) (string-append a " okay")) Typed-racket produces error: *"Type Checker: type mismatch expected: String given: Any"* when type of *a* can easily be inferred. Solution is to infer type, or leave code untyped in some default way. Another problem require/typed - wraps code with contracts what have negative impact on performance, sometimes really bad one. I just find current typed\racket condition unpractical. I need for example to write my own untyped lib for using another untyped lib to simplify interfaces and make impact on performance more acceptable. It seams what I am asking for here is unsound typing. Another option is to force! typed racket on all levels in all libs. I am not so big expert in theory of language design.. There is some paper I found www.ccis.northeastern.edu/home/types/publications/gradual-dead/pre-treatment.pdf on this matter, called "Is Sound Gradual Typing Dead?" from Northeastern University, it highlights some of the problems in more scientific way. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/bfaf043a-fe05-40a9-952b-6490f5b7d364%40googlegroups.com.