Jai - interesting programming language
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Sat Mar 19 17:10:53 PDT 2016
On 19.03.2016 09:38, Basile B. wrote:
>
>
> identifier : type = initializer; // straight declaration
> identifier : type; // no init
> identifier := initializer; // infered type
>
>
>
> However later in the function declaration:
>
> "sum := (x: float, y: float, z: float) -> float {
> return x + y + z;
> };"
>
> I would expect the same system as for variables:
>
> "sum : float = (x: float, y: float, z: float) {
> return x + y + z;
> };"
That's not the same system. This would claim that everything after the
"=" sign is of type float, which is clearly isn't, even if type
inference was allowed.
One thing that is strange about the syntax is that they use identifier:
type everywhere except for struct fields.
More information about the Digitalmars-d
mailing list