3 ms·
Yeah, just because the language doesn’t force you to specify types, doesn’t mean that the compiler can’t infer them for you. What was most eye-opening for me a
by fiddlerwoaroof 8y ago
Yeah, just because the language doesn’t force you to specify types, doesn’t mean that the compiler can’t infer them for you.
What was most eye-opening for me about CL was just how helpful the compiler of a dynamically typed programming language can be.
- fjsolwmv 8y agoChecking dynamic types us not the work of a compiler. Checking types at compile time is static type checking. If a type is wholly dynamic (determined at runtime via something like casting to a type specified in user input), the compiler can't check it. (Also, type inference is orthogonal to static vs dynamic typing.)
- phoe-krk 8y ago> Checking dynamic types us not the work of a compiler. Checking types at compile time is static type checking. By your logic, Common Lisp is both dynamically and statically typed, because compile-time type checks are done by the compiler and warnings/errors are signaled whenever proper. More, if you declare (OPTIMIZE SPEED), the compiler is going to print a list of all places where it was unable to infer types on its own and where it expects help from the programmer in form of type declarations for individual variables.