Rename "Parameter Call" to something that makes sense
mbellotti opened this issue · 2 comments
File this under: I don't know why I did this 🤣
Structs (Stocks, Flows, and Components) are basically like objects:
def foo = flow{
buzz: new bar,
fizz: func{
if buzz.a > 2{
buzz.a -> b;
}else{
buzz.a = 10;
}
buzz.b -> 1;
},
};
def bar = stock{
a: 10,
b: 20,
};
Each has a set of features that are kind of like properties or methods. These features can be accessed via the following construction buzz.a
in the parser this construction is called a ParameterCall ... which is a stupid name that doesn't really communicate what it is. These features ARE treated as parameters when represented in LLVM IR, but it's still a pretty confusing name.
A Fault spec works is by connecting Stocks and Flows together to represent resource use in a system (see Thinking In Systems for more about this style of modeling) Struct properties can be static values, instances of connecting structs, or functions. When referenced with the construction [structName].[property]
if the feature is a function, Fault will execute the function.
Assuming we can come up with a more sensible name this is basically a find and replace job after that, with the guiding hand of unit tests to help 🤣
Just needs a name for this to be ready to start? What about StructProp
or StructProperty
?
Correct!
I was thinking of just renaming them to Call
or something :/ StructProperty would work but I used that already in the AST for something else that's typically over-engineered as well.