3 ms·
If it's dynamic, one can do that in CLOS+MOP with extensions like predicate dispatch or similar. If it's static like possible in some ways in C++, then Common
by lispm 11y ago
If it's dynamic, one can do that in CLOS+MOP with extensions like predicate dispatch or similar.
If it's static like possible in some ways in C++, then Common Lisp won't support it, because it generally lacks a full featured compile-time static type system.
> could come up with generic functions that dispatch on types
But how would you know that a vector only contains ints between 100 and 200 or characters from A to Z?
Either a) we can express that in the type system for compile time, we carry complex type annotations for runtime objects, or we do a check at runtime.