Cannot do nested iteration over hash tables

Bug #1010493 reported by Patrick Stein on 2012-06-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

From the iterate website

Can't iterate over nested Hashtables

Found by Bob Hutchison. It's related to 2.1, "Macrolets in the iterate form":

 (iter (for (k1 v1) in-hashtable ht1)
       (iter (for (k2 v2) in-hashtable ht2)
             (format t "~A ~A~%" k1 k2)))
This fails with the typical macrolet error. Why? Hah.

It's the fault of the new IN-HASHTABLE code that makes use of WITH-HASHTABLE-ITERATOR. The iterator is specified to be defined by a symbol-macrolet. I think we'll have to make a rudimentary macrolet walker. Argh. Hmpf.

This affects nested package walking, as well. A solution to one will probably be a solution to both.

Patrick Stein (nklein) wrote :

See Bug #1010497 for more information about macro lets in the iterate form.

Robert P. Goldman (rpgoldman) wrote :

What is "the typical macrolet error"? Anyone know?

Patrick Stein (nklein) wrote :

I took that to mean Bug #1010497

The walker calls macroexpand when there is a macro function declared for the car of a list. But, it can't really do the same when it's a macrolet or symbol-macrolet.

Attila Lendvai (attila-lendvai) wrote :

walking macrolet, and generally dealing with lexical bindings, requires a much smarter walker.

in hu.dwim.reiterate it works because it uses hu.dwim.walker, but the transitive closure of dependencies are much more than for iterate...

and the lexenv handling also requires a portability layer.

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

Other bug subscribers