4 ms·
I don't write Lisp myself, but I support SBCL-based apps running in production, and it's a very interesting beast. The REPL and the debugger/inspector are amazi
by core-questions 6y ago
I don't write Lisp myself, but I support SBCL-based apps running in production, and it's a very interesting beast. The REPL and the debugger/inspector are amazingly powerful.
I still find Lisp itself very hard to read, though. I understand the whole homoiconicity thing, and how S-expressions are one of the simplest implementations of that, but it's things like "car"/"cdr" instead of some reasonable memorable name (say, "first"/"rest") that kill me. Just don't seem to have the brain space for it.
- rvense 6y agoI've done quite a bit of Scheme in the past, but I've been playing with Common Lisp a little recently, and I often find myself thinking things like "how do I convert a string to a list of characters" or "how do I check if this thing is in this list", like simple standard library stuff that I could implement myself but expect to already be there, and then I go look in the Hyperspec, and sometimes it's hard to find thing when you don't have a name to look up.
- guenthert 6y agoTrue, but there is The Common Lisp Cookbook project to help with exactly such: http://cl-cookbook.sourceforge.net/strings.html http://cl-cookbook.sourceforge.net/strings.html
- rvense 6y agoThat looks great, thanks!
- vindarel 6y agoThe Sourceforge version is old, please see https://lispcookbook.github.io/cl-cookbook/ https://lispcookbook.github.io/cl-cookbook/ !
- vindarel 6y agoPleeeeeeeeeeeease link to the recent Cookbook :) https://lispcookbook.github.io/cl-cookbook/ https://lispcookbook.github.io/cl-cookbook/
- TeMPOraL 6y agoFWIW, "first" and "rest" are literally aliases for "car" and "cdr" (and there's a bunch more, see [0]), so it may be that the code you're working with isn't following a good style. The general style rule for more modern code is that you use "first"/"rest" if you're dealing with regular lists, and "car"/"cdr" if you're doing something more peculiar with cons cells - though it's not universally followed, and I guess at this point "car"/"cdr" & friends are too established in the history of Lisp. -- [0] - http://clhs.lisp.se/Body/f_firstc.htm http://clhs.lisp.se/Body/f_firstc.htm