This lets me finally start cleaning up a lot of the duplication within the root scope, and makes map possible as a method call.
There are still some corner cases:
Because of shortcuts taken, functions passed by name into map always resolves to the first definition of that function, so for now I just re-ordered the string constructor functions to work around this.
Since interfaces don't exist yet, it's treating all generic type names as if they're bound to an implicit Any interface. Once I have interfaces, I want that binding to be explicit and if there is no binding it should refuse to infer the generic type and require it to be defined when you call the generic function.
Since it's all implict Any, it's not doing any constraint checking on what it infers beyond just confirming that it infers the same type in all locations that particular generic type is specified.
There's still no automatic return type inference when the return type is elided from a function definition. In Alan that should always be safe once the input types are determined -- literally just take the return Microstatement's type once the function has been constructed.
I had to make some clones that I'm not proud of, so the test suite has slowed down by more than just the extra tests would imply. It looks like it's ~5% slower than before?
This lets me finally start cleaning up a lot of the duplication within the root scope, and makes
map
possible as a method call.There are still some corner cases:
map
always resolves to the first definition of that function, so for now I just re-ordered thestring
constructor functions to work around this.Any
interface. Once I have interfaces, I want that binding to be explicit and if there is no binding it should refuse to infer the generic type and require it to be defined when you call the generic function.Any
, it's not doing any constraint checking on what it infers beyond just confirming that it infers the same type in all locations that particular generic type is specified.return
Microstatement's type once the function has been constructed.clone
s that I'm not proud of, so the test suite has slowed down by more than just the extra tests would imply. It looks like it's ~5% slower than before?