3 ms·
To add to that question ... how did you use pattern matching to replace the composability of car/cdr?
by metaobject 10y ago
To add to that question ... how did you use pattern matching to replace the composability of car/cdr?
- abecedarius 10y agoMy new Lisp dialect is https://github.com/darius/squeam https://github.com/darius/squeam (and as it says, I'm not wishing it on anyone else). Pattern matching would replace a call like cadar with a pattern like ((_ x @_) @_). Using cadar is sort of like point-free style in Haskell: they both invite you to mentally run a chain of operations to understand the meaning, in contrast to patterns and expressions with named variables, which are more like a picture of the input and output. Of course pattern matching goes way back, but I used to think of it as less settled -- people might want to extend the kernel language with pattern matching in many different ways. Now I'd be more surprised by a new Lisp without some sensible default; plus if it is absent, you can add it in under a page of code, like http://okmij.org/ftp/Scheme/macros.html#match-case-simple http://okmij.org/ftp/Scheme/macros.html#match-case-simple
- kruhft 10y agoThank you for sharing your work. I could see some good use out of it.
- abecedarius 10y agoI hope it does become useful, thanks! So far it's more of a hobby.