Skip to content

Commit

Permalink
how_it_works.md: Change wiki link to the new documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-develop committed Jul 26, 2024
1 parent 3f60094 commit 56ca902
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion how_it_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@
}
}

When the Interpreter wants to create a variable, it creates an entry in the symbol table of the current Context. If it wants to access a variable, it checks in the symbol table of the current Context, but also in its parent, and its parent’s parent, etc. The only case where it doesn’t look into the parent symbol table is in built-in functions, because otherwise if an optional parameter is not given but the user already have a variable with the same name, the interpreter will look to this variable (see issue [#10](https://github.com/jd-develop/nougaro/issues/10)). By the way, this is why it is recommended in [this wiki page](https://github.com/jd-develop/nougaro/wiki/Write-libs#get-arguments) to use the `getf` method of symbol table in built-in functions (see the difference in the code between `get` and `getf`).
When the Interpreter wants to create a variable, it creates an entry in the symbol table of the current Context. If it
wants to access a variable, it checks in the symbol table of the current Context, but also in its parent, and its
parent’s parent, etc. The only case where it doesn’t look into the parent symbol table is in built-in functions,
because otherwise if an optional parameter is not given but the user already have a variable with the same name, the
interpreter will look to this variable (see issue [#10](https://github.com/jd-develop/nougaro/issues/10)). By the way,
this is why it is recommended in [this doc page](https://nougaro.github.io/jd-develop/documentation/1.0/Expand/Write-libs#get-arguments)
to use the `getf` method of symbol table in built-in functions (see the difference in the code between `get` and `getf`).

The symbol table is set to its default value at the beginning of the execution of a program, using [this file](src/runtime/set_symbol_table.py)

Expand Down

0 comments on commit 56ca902

Please sign in to comment.