alantech / alan

Autoscalable Programming Language
https://alan-lang.org
MIT License
305 stars 10 forks source link

Better function dispatch and more array methods #787

Closed dfellis closed 2 months ago

dfellis commented 2 months ago

While working on adding more array methods, the limitations of the temporary function dispatch logic I had were preventing these new functions to actually be useable, because the correct function was not being selected when multiple had the same name in some situations.

This PR improves on this a lot (but not perfectly; it's only matching one statement at a time, so it may fail if it needs to cross multiple statement boundaries. I need to do a lot of reworking to resolve that), getting the closures_by_name test to actually work, rather than me cheating by reordering the function definitions, and implementing filter, reduce, and more array functions.