-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Currently, expr
uses only string values internally. This means that for an expression like 1 + 2 + 9
is evaluated as follows:
- Get the strings
"1"
and"2"
- Parse them into integers
1
and2
- Add them to get
3
- Turn
3
into the string"3"
- Parse
"3"
back into the integer3
- Parse
"9"
into9
- Add them to get
12
- Turn
12
into the string"12"
That's a lot of parsing and stringifying. Instead we could have an enum
that can contain either an integer or a string which can be turned into the desired value.