Iterate is a macro for, well, iterating over different things in different ways. It is similar in spirit to Common Lisp iterate library, however, it tries to be better suited for Emacs context. I.e. it extends to do some tasks common for Emacs Lisp programs. For example, it can iterate over words in buffer.
The project’s homepage (the code repository): http://code.google.com/p/i-iterate/ It has more extensive documentation which comes in form of GNU/info or HTML files.
The project is being currently worked on, however, many parts should be usable already. I would be happy if someone took interest in it, and that would allow me to do both better testing and, perhaps, get a better idea of the features one may desire in this kind of library.
Here are some examples:
(note that the macro is aliased as ++, but if you don’t like that, the full name is i-iterate)
;; Prints "Hello, world!" 100 times (++ (repeat 100) (message "Hello, world!")) ;; Binds a and b to the first and second element of the list in ;; the car of the cons cell of the list being iterated (++ (for (a b) in '((1 2) (3 4))) (message "a: %s, b: %s" a b)) ;; Iterates over an array and prints its elements (++ (for i across [1 2 3 4]) (message "i: %d" i))
There is an existing CommonLisp
‘iterate’ macro: http://common-lisp.net/project/iterate/doc/Don_0027t-Loop-Iterate.html. It would be helpful if you would describe its relation to your code (differences etc.). It would be great to have something similar for Emacs. Thx – DrewAdams
I’m working on more conscious documentation, and, of course, that is the library I mentioned in the description. I wasn’t sure whether to link it here, because I’m not working on that other library, just a regular user. I have already some documentation, for what is functional, it’s either in the Googlecode Wiki, or comes with the project as info and html files, but there are still things to be done. http://code.google.com/p/i-iterate/wiki/Iterate here’s what I have so far. – wvxvw
I, for one, am very glad you’re working on this. Good luck! This would be a great addition to Emacs itself. Have you already signed papers for contributing to GnuEmacs, or if not would you consider doing so? – DrewAdams
I’ve written to MELPA maintainers and will try to get the code installable through their repository. I’ve not talked to FSF because… well, I think it’s a bit too early :) it would be good to see the uses of the package and to roll it for at least one major version update before submitting it, methinks. OK, I actually need to get to finishing some stuff about it, so, back to work! :) – wvxvw