2 ms·
Schemer here, so this question may be silly, but can't you declare or declaim or proclaim or whatever (safety 3) to get stricter typechecking?
by tmtvl 4y ago
Schemer here, so this question may be silly, but can't you declare or declaim or proclaim or whatever (safety 3) to get stricter typechecking?
- Jtsummers 4y agoThose are only advice to the compiler, but importantly `safety` is about run-time error checking. Pushing `speed` higher and dropping `safety` to 0 means that runtime type checks might be removed for certain things, but it's not required to. Like if you've similarly declared that a variable definitely holds a `fixnum`, it'll believe you whether that turns out to be the right thing in the end or not. But again, it's advice. The compiler could leave those runtime checks in place, too.
- pfdietz 4y agoAn aside: never declare something to be a fixnum in Common Lisp. Fixnum means different things in different CL implementations, so this is a good way to get unportable code. Instead, use explicit integer range types.