Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does Seed7 not use type inference?

inference seed7 type
0
10 Posted

Why does Seed7 not use type inference?

0
10

Seed7 has a basic principle that would break if type inference would be used: For every expression (and sub expression) you know its type at compile time without knowing where this expression is used. It is exactly the violation of this principle that makes type inference possible. As long as this principle holds you need to know the global and local declarations to find out the result type of an expression. With type inference it is necessary to take other expressions in the local function and even expressions in other functions into account. I do not say that this is not possible (for sure it is an interesting challenge to invent an algorithm to do this). But the reader of the program needs to use this algorithm also every time he/she reads the program. And that is very bad since a program is more often read than written.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123