eigenhombre / PyClojure

(Parts of) Clojure implemented on top of Python
Other
113 stars 13 forks source link

Make python compatablity much easier by letting PyClojure inherit python native objects. #23

Closed lclarkmichalek closed 12 years ago

lclarkmichalek commented 12 years ago

By subclassing raw objects things like iteration become much easier. Calling (map round [1.0 2.3 4.3]) will now work because the vector class inherits from the ImmutableVector class which is an iterator that map will accept.

I also added a new ComparableIter class to allow comparison between PyClojure lists and vectors, python lists, and 3rd party iterables. The addition of the __ne__ method to ComparableExpr was because Atom() != Atom() was the same as Atom() == Atom(), which wasn't correct.

Also added some new tests. I used the coverage plugin to test the coverage and core is at 94%, with the majority of untested methods being __repr__ or something similar.