Explanation about the use of '@' token #76
-
In The "type" type you explain that
With your latest commit(s), you show the new inferred methodology for an array: What got me wondered though is why we need to have a typecast method and not something like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Because the syntax would be ambiguous for other type expressions, suppose |
Beta Was this translation helpful? Give feedback.
Because the syntax would be ambiguous for other type expressions, suppose
(@[4]integer){1,2,3,4}
could be simplified to@[4]integer{1,2,3,4}
, then(@integer)(1)
would be also simplified to@integer(1)
as a side effect, but nowinteger(1)
is ambiguous, is this a type initialization or a generic type? This is an example, there are other syntax problems in allowing that, for both the parser and the reader. Type expressions in the middle of usual expressions must be surrounded by(@
)
because dropping these tokens make many cases ambiguous and confusing. This is b…