empirical-soft / empirical-lang

A language for time-series analysis
https://www.empirical-soft.com/
Other
168 stars 13 forks source link

Casting and Constructors with templates and data expressions #62

Open chrisaycock opened 4 years ago

chrisaycock commented 4 years ago

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 commented 4 years ago

The middle item was fixed in #77.