corywalker / expreduce

An experimental computer algebra system written in Go
MIT License
388 stars 26 forks source link

New implementations of Map and MapIndexed #117

Closed cekdahl closed 7 years ago

cekdahl commented 7 years ago

The goal for this pull request was to figure out how to deal with level specifications. The following two functions have been implemented:

Map existed before, but it did not accept level specifications.

corywalker commented 7 years ago

Thanks for this change! I like how this implementation seems easily reusable with other parts which may require level specs. I have one small request before merging. Instead of the last commit to fix the build error, could we have something like this:

https://pastebin.com/2MtMqLma

I'm trying to move towards using constructors for these instantiations. The constructors will save headaches if we ever need to add a field that defaults to a certain value.

cekdahl commented 7 years ago

Great, fixed it.

corywalker commented 7 years ago

Thanks. I'll merge once I see the tests pass.