Replies: 2 comments
-
Potentially we can also merge the variable lookup to the type system, addressing issues like #597, where we then distinguish the types "string" and our own variable |
Beta Was this translation helpful? Give feedback.
0 replies
-
Updates!! I have picked up work on this, follow it in this draft PR: #1041 We are following the approach above of adding the types when we also create the lookup table. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In some cases, we would like to know the type of a variable to detect whether operations are allowed, like adding a list to a number. Issues that relate to this are #745 and #791 and of course a lot of errors we see in saved programs too.
Of course the generated Python will fail, and we could translate those error messages into something more friendly, but we could do a lot more if we'd implement a simple type system so we can say something like "you can select randomly from a list" for #791 and we can disallow things lik printing a list that Python allows because I think printing a list is not a thing that a kids wants for a while (it does not contribute to DG6, and it exposes them to ugly syntax they have not yet seen like [])
Clearly this is a lot of (cool!) work, so I don't think I will be picking this up but maybe we can find a student or a volunteer in the community.
Beta Was this translation helpful? Give feedback.
All reactions