empirical-lang
empirical-lang copied to clipboard
Casting and Constructors with templates and data expressions
The new metaprogramming tools for defining types currently don't work with function-call syntax.
>>> data I = Int64
>>> I("12")
Error: wrong number of arguments; expected 0 but got 1
>>> data Person = {name: String, age: Int64}
>>> Person("A", 1)
Not yet implemented: FunctionCall not on builtin, function, or kind
>>> func inc{T}(x: T): return x + T(1) end
>>> inc{Float64}(5.5)
Error: wrong number of arguments; expected 0 but got 1
The middle item was fixed in #77.