mikosik / smooth-build

build tool with functional language
Apache License 2.0
10 stars 0 forks source link

Add `Lambda` to ObjectDb #132

Closed mikosik closed 2 years ago

mikosik commented 3 years ago

ObjectDb should be capable of storing expressions (Lambdas). This way it would be possible to store global-referencables (both functions and values) in ObjectDb. This allows refactoring TaskCreator so it doesn't need Definitions and resolving both parameter-references and function/values-references can be done through Scope. Expressions could be represented by Expr class. Expr should have integer/enum representing type of expression and list of children being subexpr (for example stringLiteral expression will have only one child being Str, arrayLiteral will have unlimited number of children being Expr). Expr should have subclasses each for different kind of expression (string literal, call, field-access, etc) so it is easy to use it and ObjectDb can also find corruption problems when reading from disk. SModule class should be refactored as it will no longer need hash and referencingModules.