Closed chrisaycock closed 4 years ago
We want to use the type of a value.
>>> let x = 1 >>> x 1 >>> type_of(x) Int64 >>> var y: type_of(x) >>> Int64 <type: Int64> >>> type_of(Int64) Kind(Int64)
We also want to get the definition of datatypes:
>>> data Person: name: String, age: Int64 end >>> columns(Person) name: String age: Int64
Lastly, we want to get function information:
>>> func foo(x: Int64): return x + 1 end >>> foo(7) 8 >>> foo <func: foo> >>> (+) <func: (+)> >>> type_of(foo) (Int64) -> Int64 >>> type_of(sum) overloaded: ([Int64]) -> Int64 ([Float64]) -> Float64 ([String]) -> String
Proposed solution:
FunctionCall
type_of
TypeOf
def_of
DefOf
OverloadedId
Kind
FuncType
DataRef
FuncRef
This will fix #29
We want to use the type of a value.
We also want to get the definition of datatypes:
Lastly, we want to get function information:
Proposed solution:
FunctionCall
in the HIRtype_of
becomesTypeOf
node with resolved refdef_of
becomesDefOf
node with a resolved stringOverloadedId
withKind
typeOverloadedId
withFuncType
DataRef
FuncRef
This will fix #29