4 ms·
> It's just not Lisp-y :-) ...but you can do it in Clojure, right? (honestly I don't know anything about Clojure). I guess some diehard old-school lispers don
by GregBuchholz 10y ago
> It's just not Lisp-y :-)
...but you can do it in Clojure, right? (honestly I don't know anything about Clojure). I guess some diehard old-school lispers don't consider Clojure lispy. Is there another way it isn't lispy? Certainly someone could come up with generic functions that dispatch on types, and then the problem would be trivial. The "filtered-functions" mentioned above, seems to have the machinery required.
- lispm 10y agoIf 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.