asc-community / asc-community/AngouriMath
Look up for types in the assembly to be able to parse them from a string?
Open
Opinions wanted
Proposal
- Dominant language
- C#
- Stars
- 831
- Forks
- 79
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 309
Description
For example, I've defined my own entity in the assembly:
```cs
record DoubleSin(Entity Arg) : FunctionEntity
{
public string ParsableName { get; } = "double_sin";
...
}
```
Then, what if the parser could look up the types, inherited from `FunctionEntity` whose `ParsableName` equals the encountered string and if there exists one, create an instance of it? So that this
```cs
Entity expr = "double_sin(x) + x";
```
would be same as
```cs
Entity expr = new DoubleSin(x) + x;
```
Contributor guide
Assessment
This issue has not been assessed yet.