mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.5K
active users

Variables in the programming language: the compiler maintains a list of symbol tables.

Each function has its own scope for local variables, effectively appending a new symbol table to that list, and popping it when the function's scope ends. 🧵

Antonio Caggiano

When defining a variable, a new entry (𝚗𝚊𝚖𝚎, 𝚊𝚍𝚍𝚛𝚎𝚜𝚜 𝚒𝚗 𝚖𝚎𝚖𝚘𝚛𝚢) is added to the most recent symbol table (local scope, back of the list).

When using a variable, the compiler looks for it in the list of symbol tables from the most recent (back of the list) to the least recent (front of the list).
If it does not find it, a 𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎 𝚞𝚗𝚍𝚎𝚏𝚒𝚗𝚎𝚍 error is emitted.