You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no obvious place to put the handling of import-declarations. A new datatype in Declaration in the AST would preferably be used, thus making the import available in the interpreter. A problem arises from this due to the fact that it's the REPL (loli.lp) that handles loading of files and not the actual interpreter.
The text was updated successfully, but these errors were encountered:
Handling modules could require quite a bit of work. It would be nice to do it, but other things are higher priority.
From the interpreters perspective a module could be viewed as an environment (map from identifiers to values). Each loaded module would be stored in memory as a separate environment, and you would have a map from module names to their environments. Then when loading a module you would have to add its environment to the start environment for that module. If the module has not already been loaded you would have to recursively load it first. So you would have a kind of meta-environment that maps module names to their environment. For the type checker you do the same thing but with type environments.
There is no obvious place to put the handling of import-declarations. A new datatype in Declaration in the AST would preferably be used, thus making the import available in the interpreter. A problem arises from this due to the fact that it's the REPL (loli.lp) that handles loading of files and not the actual interpreter.
The text was updated successfully, but these errors were encountered: