4 ms·
Why "nearly"? Given how symbols are uppercased upon read in CL, 'string and 'String are actually the same symbol. I just checked: `(typecase "" (String 2) (othe
by klibertp 2y ago
Why "nearly"? Given how symbols are uppercased upon read in CL, 'string and 'String are actually the same symbol. I just checked: `(typecase "" (String 2) (otherwise 3))` returns 2, as expected. I'm less sure about the `defmethod`s, but I think they'll also work.
Plus, the capitalized type name reminded me of Coalton[1], which is an internal DSL for CL that implements ML-style type system. There, the dispatch on a type (conventionally named by a capitalized symbol) happens statically.
[1] https://github.com/coalton-lang/coalton https://github.com/coalton-lang/coalton
- p_l 2y agoBecause on the phone with one hand I couldn't check if I didn't forget some detail in typecase which I use way less often than defmethod :)
- klibertp 2y agoFair! :) The HyperSpec is full of easily forgettable details that almost never matter, until they do :D There are even undefined and implementation-defined things there, which can trigger C++ PTSD on a bad day...