5 ms·
Essential Elisp libraries
- minimax 13y agoI don't think you need 'cl for dolist†. Unfortunately elisp doesn't have TCO, so what you would normally do with recursion in other lisps you have to do with loops in Emacs lisp. † http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/Loops-_0026-Recursion.html http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node...
- lispm 13y agoAs a Lisp user I prefer loop constructs over recursion. It makes the iteration explicit.
- jfb 13y agomake-hash-table is an abomination. Thanks for this.
- lispm 13y ago(make-hash-table) is too difficult?
- jfb 13y agoEnumerate the keys, please. Oh, no primitives? Well, you can just use maphash. But wait: maphash doesn't return values. So you need your k/v function to modify some state somewhere. WAT Fuck it, I'll just use an alist.
- lispm 13y agoEnumerating keys makes (MAKE-HASH-TABLE) hard to use? What? If you want to enumerate keys, write a function. In Common Lisp I write: (defun hash-table-keys (ht) (loop for k being each hash-key of ht collect k)) Done. That's Lisp. Need a function? Write it.
- jfb 13y agoCool, thanks. The problem here is in the elisp manual, then.
- gcv 13y ago> Previously, elisp package authors would try to make their code self-contained. And I fervently hope that does not change. Moving Emacs to the world of Gems/Bundler or Maven, where every package depends on two dozen half-assed libraries (each of which transitively use at least two dozen more), and where everything breaks all the time because someone decided to "upgrade" to the JSON parser in vogue this week, hardly strikes me as an improvement.
- jfb 13y agoWell, not every language culture is as tweaker as the Ruby world.
- snaky 13y agoBut we have at least one example of doing that right - CPAN.
- npsimons 13y agoHow long did it take CPAN to get that way? And I still prefer my native OS to handle packages better than some random developers; that's one of the big reasons I chose it (Debian, for the record). Good developers aren't always good sysadmins. Add to that NIH syndrome, and you get things like Gems. I can understand cross-platform stability and one-button ease of use, but quite frankly, I've already got one-button ease of use (apt-get), and I long ago gave up on proprietary software that doesn't meet my needs (handling packages properly being one of them). As for Emacs packages that haven't been packaged for my distro yet, the Emacs library itself is huge (hell, org-mode is now standard!), so if a package needs more than a repository checkout, add to load-path and require to get started, I'm going to have to question its quality.
- abecedarius 13y agoWorth mentioning that two of these libraries are by the post's author.