News for hackers. Stuff that matters.
Re:Ask PG: Lisp vs Python (2010) by lisper on Tuesday October 19, 2010 @01:24AM (#1806316)
http://rondam.blogspot.com/2008/02/joy-of-iterators.html

This lets you write things like:

(for var in form do ...

or

(for var in form collect ...

where form can be anything that has an iterator method defined on it.

There's also a macro I use called BINDING-BLOCK (BB for short) which subsumes a bunch of binding forms. So you can write things like:

(bb

  x (...)

  y (...)

  :db (q r s) (...) ; Destructuring-bind

  :mv (p q) (...) ; Multiple-value-bind

  ...

It's extensible so you can add your own clauses. Code is here:

http://www.flownet.com/ron/lisp/rg-utils.lisp

(It's a little out of date. If you want the latest let me know and I'll update it.)

There are no comments on this comment yet.