Refactor functions implementation
Previously, functions were implemented with a separate set of types that had their own code paths in the compiler, eval, etc. These changes refactor the function implementation so that functions are implemented as rules with one or more arguments. By representing functions as rules, we can avoid special casing required to support functions, e.g., during parse and compile there are a number of steps that required special casing for functions: - Parser needed separate grammar definitions for functions (which prevented them from being chained or using else) - Compiler needed separate resolver and type checker implementations which was a source of bugs. In some cases, special casing is unavoidable for now (e.g., during eval) however this could be improved in the future. Fixes #471 Fixes #467 Fixes #463
T
Torin Sandall committed
7ca542adb5eea5f5ef918d1f0de10665072500b8
Parent: 27262be