Cannot use macrolet inside iterate forms

Bug #1010497 reported by Patrick Stein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ITERATE macro
New
Undecided
Unassigned

Bug Description

From the iterate website: http://common-lisp.net/project/iterate/bugs.html

==========================================
(iterate (for i from 0 to 20)
         (macrolet ((collect-if-divisible (variable divisor result-var)
        `(when (zerop (mod ,variable ,divisor))
    (collect ,variable into ,result-var))))
           (collect-if-divisible i 3 result-3)
    (collect-if-divisible i 5 result-5))
      (finally (return (values result-3 result-5))))

would be nice to have. Currently has to be rewritten:

(macrolet ((collect-if-divisible (variable divisor result-var)
     `(when (zerop (mod ,variable ,divisor))
    (collect ,variable into ,result-var))))
  (iterate (for i from 0 to 20)
           (collect-if-divisible i 3 result-3)
    (collect-if-divisible i 5 result-5)
    (finally (return (values result-3 result-5)))))

of course, this does not work in all cases.
==========================================

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.