-
Notifications
You must be signed in to change notification settings - Fork 0
Add syntax for dynamic loops #29
Copy link
Copy link
Open
Labels
compilerSomething regarding the compilerSomething regarding the compilerenhancementNew feature or requestNew feature or requestruntimeSomething regarding the runtime moduleSomething regarding the runtime modulesyntaxSyntax support for a featureSyntax support for a feature
Metadata
Metadata
Assignees
Labels
compilerSomething regarding the compilerSomething regarding the compilerenhancementNew feature or requestNew feature or requestruntimeSomething regarding the runtime moduleSomething regarding the runtime modulesyntaxSyntax support for a featureSyntax support for a feature
Type
Fields
Give feedbackNo fields configured for Feature.
Projects
StatusShow more project fields
In Progress
Is your feature request related to a problem? Please describe.
HSL is trying to be a real programming language, however housing has too many limits for this. Recently I've found a workaround to implement loops via recursive function calls.
Describe the solution you'd like
Create fully-functional for and while loops. Lets take a look at how a
forlook should look like.Users should declare something like this:
This should be converted to housing-compliant functions:
Describe alternatives you've considered
Additional context
The merge step must be added to capture the remaining code after a loop. According to my testings, the actions after a (recursive?) function trigger DO NOT wait for the function to complete. Meaning that we can corrupt logic flow if we have any code with dependency to the loop after the loop. This forces us to put the remaining code in a merge function that is invoked after the loop is completed.