empirical-lang icon indicating copy to clipboard operation
empirical-lang copied to clipboard

Casting and Constructors with templates and data expressions

Open chrisaycock opened this issue 4 years ago • 1 comments

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

chrisaycock avatar Aug 11 '20 17:08 chrisaycock

The middle item was fixed in #77.

chrisaycock avatar Aug 21 '20 20:08 chrisaycock