gfredericks / test.chuck

A utility library for test.check
Eclipse Public License 1.0
215 stars 26 forks source link

Filtering out generated symbols #7

Closed zmaril closed 9 years ago

zmaril commented 9 years ago

When trying to generate code to destructure the results of generators with for-all, the macro was getting caught up by gen-syms. By filtering out symbols with the prefixes "map" and "vec", the macro no longer tries to generate code that references the generated symbols and works as expected (or at least how I expected it to work). A simple test was added as well.

gfredericks commented 9 years ago

Oh interesting -- the problem isn't that gensyms are inherently bad to capture this way, but since the test.chuck code calls clojure.core/destructure itself it just ends up with different gensyms than the ones that eventually get used in the course of normal destructuring.

gfredericks commented 9 years ago

I'm going to ponder whether there's an easy enough clean way to do this without guessing based on symbol names; thanks for the PR!

zmaril commented 9 years ago

No problem! I'm using this fix locally for now but I have no idea if it will come back and break something else later on. All the other tests run just fine, but I don't know enough about how for works to say if there is a cleaner way to do this.

gfredericks commented 9 years ago

Okay I think I figured out a different approach. I'll merge this to get the test, add my changes on top, then make a release.

Thanks again.

gfredericks commented 9 years ago

Version "0.1.15" is out

zmaril commented 9 years ago

This seems to work for me! Thanks for the quick release.