3 ms·
Note that this behavior is completely implementation specific and totally undefined in the Common Lisp standard.
by lispm 2y ago
Note that this behavior is completely implementation specific and totally undefined in the Common Lisp standard.
- ducktective 2y agoWhat is standard CL way to enforce these type conditions (apart from declaim)? Some spec library similar to the one Clojure has?
- NikkiA 2y ago`declaim` is just as implementation-dependant as the :type specifiers for defstruct, thus by lispm's rules, there are no 'standard' ways to apply type conditions. But then, the standard /is/ useless.
- lispm 2y agoThe standard leaves it to the implementations/implementors to decide what to do. An implementation can check all these type constraints. It may not do it, for example, if code gets compiled with the opimization quality SAFETY of 0 (and possibly SPEED = 3) or similar. It may not do it all. There are implementations which check these type constraints. So it is best to check the manual or ask the maintainers. IIRC there were implementations which added it on user requests. But don't think all "Common Lisp" implementations will check those constraints, for example ABCL does not. Some don't and in others it can be turned off.