The document at http://common-lisp.net/project/iterate/ uses this as an example of the superiority of iterate over loop:
Finding the longest list in a list of lists:
(iterate (for elt in list-of-lists)
(finding elt maximizing (length elt)))
whereas the example of how it can be done in loop is long and contorted. But loop can do
(loop for elt in list-of-lists
maximizing (length elt))
The example in 3.2 Named blocks may be better as a selling point:
(iter outer (for i below (array-dimension ar 0))
(iter (for j below (array-dimension ar 1))
(in outer (collect (aref ar i j)))))
showing that the outer loop can easily collect data produced in the inner loop.
Eivind
Hi
trying to install iterate with (asdf-install:install :iterate)
I get the following error:
....
;;; Compiling file
/Users/m.pheasant/.asdf-install-dir/site/iterate-1.4.3/iterate.lisp
Error: Unsyntactic ! syntax: "1"
It refers to the first time the !1 is seen, in defun walk:
(t ;; Lisp function call
(return-code-modifying-body #'walk-arglist (cdr form)
#L(list (cons (car form) !1))))))
any help appreciated. I was using sbcl and appreciated iterate over
loop, and would like to use it from allegro.
Cheers
Mike
--
Michael Pheasant
Software Engineer
Queensland Facility for Advanced Bioinformatics
Level 6, QBP
University of Queensland, QLD 4072
T: +61 (0)7 3346 2070
F: +61 (0)7 3346 2101
www.qfab.org