My favorites | Sign in
Project Home Wiki Issues Source
Project Information
Members

This library is inspired by the Common Lisp library with a similar name: http://common-lisp.net/project/iterate/ but it is not a direct translation. Some features were deliberately added, omitted or renamed.

This library attempts to provide macros to cover typical tasks that arise when programming in Emacs Lisp (eg. iterating over words in a buffer) as well as some task that belong in a general programming domain (eg. iterating over leafs of a tree in a breadth-first or depth-first order).

Status and readiness of the code

The code is at the stage of adding final features before the first version testing and release.

Some usage examples

(You can find more examples in the test/i-test.el)

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))

You can read the documentation here: Iterate

Installing

  1. Check out the repository
  2.  
    

    $ svn checkout http://i-iterate.googlecode.com/svn/trunk/ ~/.emacs.d/i-iterate

  3. Compile the project
  4.  
     $ cd ~/.emacs.d/i-iterate
     $ make
         
  5. Optionally, run the test
  6.  
     $ make test
         
  7. Install the project
  8. Add the following lines to your init file (usually it is ~/.emacs, you may need to create one).
     
     (add-to-list 'load-path (expand-file-name "~/.emacs.d/i-iterate/lisp/"))
     (require 'i-iterate)
         

Powered by Google Project Hosting