Looking at the code emitted by core.match, I see that literals are always compared using
While it works, wouldn't it be faster to specialize equality for different literals, such as:
(number? l) `(and (number? ~ocr) (== ~l ~ocr))
(keyword? l) `(identical? ~l ~ocr)
(nil? l) `(nil? ~ocr)
(true? l) `(true? ~ocr)
(false? l) `(false? ~ocr)
(string? l) `(.equals ~l ~ocr)
(snippet added to
Crude benchmarks show it's faster than
= and all the tests pass, too.
Think this warrants a patch?