Open MaximilianYan opened 3 months ago
In the current version of the language, there are two variable types: int64 and array of int64. In the current implementation, these two are kept in separate namespaces, see struct Context at https://github.com/GassaFM/interpr/blob/master/source/runner.d#L65-L72 and around. The rationale is that the type can be uniquely determined at site of usage, so why bother distinguishing?
So, what are the benefits and the drawbacks, and what should be done about it, if anything?
The rationale is that the type can be uniquely determined at site of usage, so why bother distinguishing?
Ok, I can accept such a notation. But also I think that such a language invariant like "the syntax must explicitly define type of variables at the site of usage" must be explicit declared somewhere.
"the syntax must explicitly define type of variables at the site of usage"
The syntax does not have an obligation to define type, it just does, partly by coincidence. This may change if the language ever gets more complex.
I think that you (as language creation coordinator) must make a decision and choose one of the paradigms:
or
.
That's one possible way.
But the language is, at least in part, a learning project. Non-blocking issues are opportunities for the students to take part. Not just by reporting stuff, but also, for example, by discussing language design.
So, as issue author, what do you think of each of the possible decisions?
what do you think of each of the possible decisions?
Probably, I am guided by a sense of beauty, but I find such a syntax attractive (mostly in cause of it's being funny and intriguing), so I would prefer legalizing the namesake-variables syntax.
Yeah, that. But what are the practical considerations, beside beauty which is mostly in the eye of the beholder?
A code
correctly (without errors being occurred) works with output (e.g., input is
1
239
).
Meanwhile, a code
(e.g., input is
1
239
) fails with an error.
I've found nothing about redeclaration of the variables in the documentation, and such a behavior seems inconsistent to me.